Print this page
1730 DTrace should ignore type information from modules with cth_parlabel mismatches
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>


  95         { EDT_DIRABORT, "Abort explicitly directed" },
  96         { EDT_BADRVAL,  "Invalid return value from callback" },
  97         { EDT_BADNORMAL, "Invalid normalization" },
  98         { EDT_BUFTOOSMALL, "Enabling exceeds size of buffer" },
  99         { EDT_BADTRUNC, "Invalid truncation" },
 100         { EDT_BUSY, "DTrace cannot be used when kernel debugger is active" },
 101         { EDT_ACCESS, "DTrace requires additional privileges" },
 102         { EDT_NOENT, "DTrace device not available on system" },
 103         { EDT_BRICKED, "Abort due to systemic unresponsiveness" },
 104         { EDT_HARDWIRE, "Failed to load language definitions" },
 105         { EDT_ELFVERSION, "libelf is out-of-date with respect to libdtrace" },
 106         { EDT_NOBUFFERED, "Attempt to buffer output without handler" },
 107         { EDT_UNSTABLE, "Description matched an unstable set of probes" },
 108         { EDT_BADSETOPT, "Invalid setopt() library action" },
 109         { EDT_BADSTACKPC, "Invalid stack program counter size" },
 110         { EDT_BADAGGVAR, "Invalid aggregation variable identifier" },
 111         { EDT_OVERSION, "Client requested deprecated version of library" },
 112         { EDT_ENABLING_ERR, "Failed to enable probe" },
 113         { EDT_NOPROBES, "No probe sites found for declared provider" },
 114         { EDT_CANTLOAD, "Failed to load module" },

 115 };
 116 
 117 static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]);
 118 
 119 const char *
 120 dtrace_errmsg(dtrace_hdl_t *dtp, int error)
 121 {
 122         const char *str;
 123         int i;
 124 
 125         if (error == EDT_COMPILER && dtp != NULL && dtp->dt_errmsg[0] != '\0')
 126                 str = dtp->dt_errmsg;
 127         else if (error == EDT_CTF && dtp != NULL && dtp->dt_ctferr != 0)
 128                 str = ctf_errmsg(dtp->dt_ctferr);
 129         else if (error >= EDT_BASE && (error - EDT_BASE) < _dt_nerr) {
 130                 for (i = 0; i < _dt_nerr; i++) {
 131                         if (_dt_errlist[i].err == error)
 132                                 return (_dt_errlist[i].msg);
 133                 }
 134                 str = NULL;




  95         { EDT_DIRABORT, "Abort explicitly directed" },
  96         { EDT_BADRVAL,  "Invalid return value from callback" },
  97         { EDT_BADNORMAL, "Invalid normalization" },
  98         { EDT_BUFTOOSMALL, "Enabling exceeds size of buffer" },
  99         { EDT_BADTRUNC, "Invalid truncation" },
 100         { EDT_BUSY, "DTrace cannot be used when kernel debugger is active" },
 101         { EDT_ACCESS, "DTrace requires additional privileges" },
 102         { EDT_NOENT, "DTrace device not available on system" },
 103         { EDT_BRICKED, "Abort due to systemic unresponsiveness" },
 104         { EDT_HARDWIRE, "Failed to load language definitions" },
 105         { EDT_ELFVERSION, "libelf is out-of-date with respect to libdtrace" },
 106         { EDT_NOBUFFERED, "Attempt to buffer output without handler" },
 107         { EDT_UNSTABLE, "Description matched an unstable set of probes" },
 108         { EDT_BADSETOPT, "Invalid setopt() library action" },
 109         { EDT_BADSTACKPC, "Invalid stack program counter size" },
 110         { EDT_BADAGGVAR, "Invalid aggregation variable identifier" },
 111         { EDT_OVERSION, "Client requested deprecated version of library" },
 112         { EDT_ENABLING_ERR, "Failed to enable probe" },
 113         { EDT_NOPROBES, "No probe sites found for declared provider" },
 114         { EDT_CANTLOAD, "Failed to load module" },
 115         { EDT_BADCTF, "Module contains invalid or incomplete CTF information" }
 116 };
 117 
 118 static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]);
 119 
 120 const char *
 121 dtrace_errmsg(dtrace_hdl_t *dtp, int error)
 122 {
 123         const char *str;
 124         int i;
 125 
 126         if (error == EDT_COMPILER && dtp != NULL && dtp->dt_errmsg[0] != '\0')
 127                 str = dtp->dt_errmsg;
 128         else if (error == EDT_CTF && dtp != NULL && dtp->dt_ctferr != 0)
 129                 str = ctf_errmsg(dtp->dt_ctferr);
 130         else if (error >= EDT_BASE && (error - EDT_BASE) < _dt_nerr) {
 131                 for (i = 0; i < _dt_nerr; i++) {
 132                         if (_dt_errlist[i].err == error)
 133                                 return (_dt_errlist[i].msg);
 134                 }
 135                 str = NULL;