42 #define LF_U_CFG 1 << 1
43 #define LF_U_PROBE 1 << 2
188 g_hash_table_iter_init(&iter,
fprobes);
189 while (g_hash_table_iter_next(&iter,
199 g_hash_table_iter_init(&iter,
sprobes);
200 while (g_hash_table_iter_next(&iter,
214 if (sigismember(&
exitset,signo)) {
220 int ttctx,
int ttdetail,
int bt,
int overlay_levels,
221 char *overlay_debuginfo_prefix,
char *sep,
char *kvsep,
222 char *tprefix,
char *tsep) {
230 struct target *overlay;
236 else if (ttctx == 1) {
237 tids = array_list_create(1);
238 array_list_append(tids,(
void *)(uintptr_t)tid);
240 else if (ttctx == 2) {
241 tids = array_list_create(8);
248 array_list_append(tids,(
void *)(uintptr_t)ttid);
249 ttid = tthread->
ptid;
252 else if (ttctx == 3) {
256 tids = array_list_create(1);
257 array_list_prepend(tids,(
void *)(uintptr_t)tid);
267 if (tthread->
tid == tid && didmaintid)
269 else if (tthread->
tid == tid)
272 fprintf(stream,
"%s",tsep);
275 ttdetail,sep,kvsep) < 0)
276 fprintf(stream,
"%s[tid=%"PRIiTID"",tprefix,tthread->
tid);
278 fprintf(stream,
"%s[%s",tprefix,buf);
284 fprintf(stream,
"%sbacktrace=[error!]",sep);
286 fprintf(stream,
"%sbacktrace=[empty]",sep);
288 fprintf(stream,
"%sbacktrace=[%s]",sep,buf);
296 otl = array_list_create(8);
299 while (overlay_levels != 0) {
304 if (overlay_debuginfo_prefix)
313 fprintf(stream,
"%s",tsep);
316 ttdetail,sep,kvsep) < 0)
317 fprintf(stream,
"%s[overlay=%s%stid=%"PRIiTID"",
318 tprefix,overlay->
name,sep,ttid);
320 fprintf(stream,
"%s[overlay=%s%s%s",
321 tprefix,overlay->
name,sep,buf);
328 fprintf(stream,
"%sbacktrace=[error!]",sep);
330 fprintf(stream,
"%sbacktrace=[empty]",sep);
332 fprintf(stream,
"%sbacktrace=[%s]",sep,buf);
339 array_list_prepend(otl,overlay);
347 array_list_free(otl);
351 array_list_free(tids);
355 int overlay_levels,
char *overlay_debuginfo_prefix) {
369 stid = (int)strtol(tiddesc,&endptr,10);
370 if (tiddesc == endptr)
386 if (stid == -1 && !tiddesc) {
387 tids = array_list_create(1);
388 array_list_append(tids,(
void *)(uintptr_t)ctid);
390 printf(
"Backtracing target '%s' (current thread %d):\n\n",t->
name,ctid);
393 tids = array_list_create(1);
394 array_list_append(tids,(
void *)(uintptr_t)stid);
396 printf(
"Backtracing target '%s' (thread %d):\n\n",t->
name,stid);
401 printf(
"Backtracing target '%s' (thread name %s):\n\n",t->
name,tiddesc);
406 printf(
"Backtracing target '%s' (all threads):\n\n",t->
name);
414 if ((tiddesc && !tthread->
name)
415 || (tiddesc && strcmp(tiddesc,tthread->
name)))
421 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": (error!)\n",
424 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": (nothing)\n",
427 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": \n%s\n",
430 if (overlay_levels == 0)
436 otl = array_list_create(8);
438 while (overlay_levels != 0) {
443 if (overlay_debuginfo_prefix)
455 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": (error!)\n",
458 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": (nothing)\n",
461 fprintf(stdout,
"\ntarget %s thread %"PRIiTID": \n%s\n",
462 overlay->
name,tid,buf);
466 array_list_prepend(otl,overlay);
474 array_list_free(otl);
495 stid = (int)strtol(tiddesc,&endptr,10);
496 if (tiddesc == endptr)
512 if (stid == -1 && !tiddesc) {
513 tids = array_list_create(1);
514 array_list_append(tids,(
void *)(uintptr_t)ctid);
516 printf(
"Signaling target '%s' (current thread %d):\n\n",t->
name,ctid);
519 tids = array_list_create(1);
520 array_list_append(tids,(
void *)(uintptr_t)stid);
522 printf(
"Signaling target '%s' (thread %d):\n\n",t->
name,stid);
527 printf(
"Signaling target '%s' (thread name %s):\n\n",t->
name,tiddesc);
532 printf(
"Signaling target '%s' (all threads):\n\n",t->
name);
540 if ((tiddesc && !tthread->
name)
541 || (tiddesc && strcmp(tiddesc,tthread->
name)))
546 fprintf(stdout,
"thread %"PRIiTID": (error!)\n",tid);
548 fprintf(stdout,
"thread %"PRIiTID": success\n",tid);
550 fprintf(stdout,
"thread %"PRIiTID": unknown status %d\n",tid,rc);
559 struct probe *trigger,
struct probe *base) {
572 struct probe *fprobe;
586 verror(
"probe %s: could not create action on probe %s !\n",
590 verror(
"probe %s: could not schedule action on probe %s!\n",
596 "probe %s: scheduled return action on probe %s\n",
606 fprobe = (
struct probe *) \
609 vwarn(
"probe %s: cannot enable nonexisting filter probe %s!\n",
615 "probe %s: enabled filter probe %s\n",
624 fprobe = (
struct probe *) \
627 vwarn(
"probe %s: cannot enable nonexisting filter probe %s!\n",
644 fprobe = (
struct probe *) \
647 vwarn(
"probe %s: cannot remove nonexisting filter probe %s!\n",
661 if (spfa->
exit.retval == -69) {
685 vwarn(
"probe %s: could not get values from probe %s"
693 fprintf(stdout,
"RESULT:: (%c:%d) %s (%d) %s %s (",
701 g_hash_table_iter_init(&iter,vt);
702 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
705 v = (
struct value *)vp;
710 for (j = 0; vstrbuf[j] !=
'\0'; ++j) {
711 if (!isgraph(vstrbuf[j]) && !isspace(vstrbuf[j])) {
718 vwarn(
"unprintable raw value for key %s = 0x",
720 for (j = 0; vstrbuf[j] !=
'\0'; ++j) {
721 vwarnc(
"%hhx",vstrbuf[j]);
725 fprintf(stdout,
"%s=??",(
char *)kp);
728 fprintf(stdout,
"%s=%s",(
char *)kp,vstrbuf);
732 fprintf(stdout,
"%s=?",(
char *)kp);
735 fprintf(stdout,
"%s=?",(
char *)kp);
743 spfa->
report.overlay_debuginfo_prefix,
744 ";",
":",
"thread=",
",");
745 fprintf(stdout,
") ::RESULT\n");
754 vwarn(
"probe %s: could not get values from probe %s"
766 g_hash_table_iter_init(&iter,vt);
767 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
772 v = (
struct value *)vp;
776 fprintf(stdout,
"%s = %s",(
char *)kp,vstrbuf);
778 fprintf(stdout,
"%s = ?",(
char *)kp);
781 fprintf(stdout,
"%s = ?",(
char *)kp);
789 fprintf(stdout,
" = ?");
794 v = (
struct value *) \
799 fprintf(stdout,
" = %s",vstrbuf);
801 fprintf(stdout,
" = ?");
808 0,0,NULL,NULL,NULL,
"",
",");
813 if (spfa->
bt.tid > 1) {
816 verror(
"no existing target with id '%d'!\n",spfa->
bt.tid);
824 spfa->
bt.overlay_debuginfo_prefix);
827 if (spfa->
signal.tid > 1) {
830 verror(
"no existing target with id '%d'!\n",
841 verror(
"probe %s: bad action type %d -- BUG!\n",
850 struct probe *trigger,
struct probe *base) {
855 struct probe *trigger,
struct probe *base) {
865 struct probe *trigger,
struct probe *base) {
870 #define __TARGET_OVERLAY 0x200000
871 #define SPF_CONFIGFILE_FATAL 0x200001
872 #define SPF_OS_SYSCALL_PROBES 0x200002
875 {
"overlay",
__TARGET_OVERLAY,
"[<target_id>:]<thread_name_or_id>:<spec_opts>",0,
"Lookup name or id as an overlay target once the main target is instantiated, and try to open it. All dumptarget options then apply to the overlay.",0 },
876 {
"config-file",
'C',
"<FILE>",0,
"An SPF config file.",0 },
878 "Make errors while applying runtime updates (via USR2) to the config file fatal.",0 },
880 "Try to use target_os_syscall probes if symbol is a syscall and target is an OS.",0 },
890 return ARGP_ERR_UNKNOWN;
893 if (state->quoted > 0)
894 opts->
argc = state->quoted - state->next;
896 opts->
argc = state->argc - state->next;
897 if (opts->
argc > 0) {
898 opts->
argv = calloc(opts->
argc,
sizeof(
char *));
899 memcpy(opts->
argv,&state->argv[state->next],opts->
argc*
sizeof(
char *));
900 state->next += opts->
argc;
907 case ARGP_KEY_NO_ARGS:
908 case ARGP_KEY_SUCCESS:
924 return ARGP_ERR_UNKNOWN;
934 int main(
int argc,
char **argv) {
937 struct probe *sprobe, *fprobe;
938 char *
name, *context;
942 char *pre_filter, *post_filter;
946 GList *base_target_specs = NULL;
947 GList *overlay_target_specs = NULL;
988 &primary_target_spec,&base_target_specs,
989 &overlay_target_specs);
992 verror(
"could not parse target arguments!\n");
996 if (
opts.config_file) {
999 verror(
"could not read config file %s!\n",
opts.config_file);
1007 base_target_specs,overlay_target_specs,
1010 verror(
"could not instantiate and open targets!\n");
1017 sprobes = g_hash_table_new(g_direct_hash,g_direct_equal);
1018 fprobes = g_hash_table_new(g_direct_hash,g_direct_equal);
1020 if (
opts.use_os_syscall_probes) {
1026 vwarn(
"could not load the syscall table for target %s;"
1027 " target_os_syscall probes will not be available!\n",
1034 pre_filter = post_filter = context = NULL;
1036 while (*str !=
'\0') {
1037 if (*str ==
':' && *(str+1) ==
':') {
1050 while (*str !=
'\0') {
1051 if (*str ==
':' && *(str+1) ==
':') {
1064 while (*str !=
'\0') {
1065 if (*str ==
':' && *(str+1) ==
':') {
1075 sprobe = (
struct probe *)g_hash_table_lookup(
sprobes,name);
1083 if (
opts.use_os_syscall_probes
1095 verror(
"could not place syscall value probe on %s;"
1096 " aborting!\n",name);
1116 verror(
"could not place value probe on %s;"
1117 " aborting!\n",name);
1127 verror(
"could not probe symbol %s; aborting!\n",name);
1132 g_hash_table_insert(
sprobes,name,sprobe);
1139 verror(
"could not parse pre_filter '%s'!\n",pre_filter);
1149 verror(
"could not parse post_filter '%s'!\n",post_filter);
1157 snprintf(namebuf,
sizeof(namebuf),
"filter_%s_%d",name,i);
1164 g_hash_table_insert(
fprobes,namebuf,fprobe);
1167 else if (!
opts.config_file) {
1169 if (access(
"spf.conf",R_OK)) {
1170 verror(
"Must supply some symbols to probe!\n");
1175 opts.config_file = strdup(
"spf.conf");
1179 verror(
"could not read default config file %s!\n",
1188 int oldfatal =
opts.config_file_fatal;
1189 opts.config_file_fatal = 1;
1191 verror(
"could not install config file %s!\n",
opts.config_file);
1195 opts.config_file_fatal = oldfatal;
1197 if (g_hash_table_size(
sprobes) == 0) {
1198 verror(
"No symbols to probe; exiting!\n");
1211 fprintf(stdout,
"Starting Symbol Probe Filtering!\n");
1214 fprintf(stdout,
"Starting thread watch loop!\n");
1235 else if (siginfo.si_signo == SIGUSR1
1236 || siginfo.si_signo == SIGUSR2
1237 || siginfo.si_signo == SIGHUP) {
1249 fprintf(stderr,
"error in target_monitor_evloop (%d): %s; aborting!\n",
1250 rc,strerror(errno));
1264 "Error handling target '%s'; closing and finalizing!\n",
1273 "Target '%s' finished; finalizing!\n",
1281 fprintf(stderr,
"Target '%s' exiting...\n",tname);
1284 fprintf(stderr,
"Target '%s' interrupted, resuming...\n",tname);
1286 fprintf(stderr,
"Could not resume target %s tid %"PRIiTID"\n",
1296 "Target '%s' tid %d received unexpected status '%s'"
1297 " at 0x%"PRIxADDR"; attempting to continue!\n",
1300 fprintf(stderr,
"Could not resume target %s tid %"PRIiTID"\n",
1402 while (*s !=
'\0') {
1410 else if (*s == encchar && !wasesc) {
1419 else if (*s ==
'\\') {
1438 if (
opts.config_file_fatal) {
1439 verror(
"could not reread config file %s!\n",
opts.config_file);
1445 vwarn(
"could not reread config file %s; leaving"
1446 " existing configuration in place!\n",
opts.config_file);
1475 GHashTable *needed = NULL;
1476 GHashTableIter iter;
1486 g_hash_table_iter_init(&iter,
fprobes);
1487 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
1488 probe = (
struct probe *)vp;
1490 g_hash_table_iter_remove(&iter);
1494 needed = g_hash_table_new(g_str_hash,g_str_equal);
1496 g_hash_table_insert(needed,spff->
symbol,NULL);
1515 if (
opts.config_file_fatal) {
1516 verror(
"could not lookup symbol %s; aborting!\n",
1523 vwarn(
"could not lookup symbol %s; skipping filter!\n",
1530 if (
opts.use_os_syscall_probes) {
1542 if (
opts.config_file_fatal) {
1543 verror(
"could not place syscall value probe on %s;"
1551 vwarn(
"could not place syscall value probe on %s;"
1552 " skipping filter!\n",
1567 if (
opts.config_file_fatal) {
1568 verror(
"could not place value probe on %s; aborting!\n",
1575 vwarn(
"could not place value probe on %s; skipping filter!\n",
1586 g_hash_table_iter_init(&iter,
sprobes);
1587 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
1588 if (g_hash_table_lookup_extended(needed,kp,NULL,NULL) == FALSE) {
1590 g_hash_table_iter_remove(&iter);
1593 g_hash_table_destroy(needed);
1599 sprobe = (
struct probe *)g_hash_table_lookup(
sprobes,spff->
symbol);
1603 snprintf(namebuf,
sizeof(namebuf),
"filter_%s_%d",spff->
symbol,i);
1604 spff->
id = strdup(namebuf);
1609 spff->
ttf,spff,0,1);
1613 spff->
ttf,spff,0,1);
1619 g_hash_table_insert(
fprobes,spff->
id,fprobe);
1638 char *token = NULL, *token2 = NULL;
1646 if (strcmp(file,
"-") == 0)
1649 ffile = fopen(file,
"r");
1651 verror(
"could not fopen config file %s: %s\n",file,strerror(errno));
1656 retval = calloc(1,
sizeof(*retval));
1659 buf = malloc(bufsiz);
1664 tbuf = fgets(buf + rc,bufsiz - rc,ffile);
1665 if (tbuf && (rc += strlen(buf + rc)) == (bufsiz - 1)
1666 && buf[bufsiz - 2] !=
'\n') {
1668 tbuf = malloc(bufsiz + 128);
1669 memcpy(tbuf,buf,bufsiz);
1674 else if (tbuf && rc < bufsiz) {
1679 verror(
"fgets: %s (aborting filter file read)\n",
1700 if (buf[strlen(buf) - 1] ==
'\n') {
1703 buf[strlen(buf) - 1] =
'\0';
1709 if (strncmp(buf,
"ProbeFilter",strlen(
"ProbeFilter")) == 0) {
1710 bufptr = buf + strlen(
"ProbeFilter");
1711 while (isspace(*bufptr)) ++bufptr;
1713 spff = (
struct spf_filter *)calloc(1,
sizeof(*spff));
1726 while (!isspace(*bufptr)) ++bufptr;
1728 spff->
symbol = strdup(token);
1729 if ((tmp = index(spff->
symbol,
':'))) {
1732 spff->
symbol = strdup(tmp+1);
1737 while (*bufptr !=
'\0') {
1738 while (isspace(*bufptr)) ++bufptr;
1739 if (*bufptr ==
'\0')
1743 while (isalnum(*bufptr) || *bufptr ==
'_') ++bufptr;
1744 if (*bufptr ==
'(') {
1751 while (isspace(*bufptr)) ++bufptr;
1757 if (strcmp(token,
"id") == 0) {
1759 while (isalnum(*bufptr) || *bufptr ==
'_') ++bufptr;
1767 spff->
id = strdup(token);
1769 else if (strcmp(token,
"when") == 0) {
1770 if (strncmp(bufptr,
"pre",strlen(
"pre")) == 0) {
1772 bufptr += strlen(
"pre");
1774 else if (strncmp(bufptr,
"post",strlen(
"post")) == 0) {
1776 bufptr += strlen(
"post");
1784 else if (strcmp(token,
"disable") == 0) {
1791 else if (strcmp(token,
"vfilter") == 0) {
1797 char *nextbufptr = NULL;
1798 while (*bufptr !=
'\0') {
1799 if (*bufptr ==
'\\') {
1805 else if (*bufptr ==
')' && !isescaped) {
1806 nextbufptr = bufptr + 1;
1817 bufptr = nextbufptr;
1819 else if (strcmp(token,
"tfilter") == 0) {
1825 char *nextbufptr = NULL;
1826 while (*bufptr !=
'\0') {
1827 if (*bufptr ==
'\\') {
1833 else if (*bufptr ==
')' && !isescaped) {
1834 nextbufptr = bufptr + 1;
1845 bufptr = nextbufptr;
1847 else if (strcmp(token,
"abort") == 0) {
1849 while (*bufptr ==
'-' || isdigit(*bufptr)) ++bufptr;
1855 numval = strtol(token,NULL,0);
1859 spfa = calloc(1,
sizeof(*spfa));
1861 spfa->
abort.retval = numval;
1866 else if (strcmp(token,
"print") == 0) {
1867 spfa = calloc(1,
sizeof(*spfa));
1870 if (*bufptr ==
')') {
1879 char *nextbufptr = NULL;
1888 while ((token = strtok_r((!token) ? bufptr : NULL,
",",
1891 while (*tptr !=
'\0') {
1902 if (strcmp(token,
"ttctx") == 0) {
1903 if (strcmp(token2,
"none") == 0)
1904 spfa->
print.ttctx = 0;
1905 else if (strcmp(token2,
"self") == 0)
1906 spfa->
print.ttctx = 1;
1907 else if (strcmp(token2,
"hier") == 0)
1908 spfa->
print.ttctx = 2;
1909 else if (strcmp(token2,
"all") == 0)
1910 spfa->
print.ttctx = 3;
1914 else if (strcmp(token,
"ttdetail") == 0) {
1915 spfa->
print.ttdetail = atoi(token2);
1920 bufptr = nextbufptr;
1926 else if (strcmp(token,
"report") == 0) {
1927 spfa = calloc(1,
sizeof(*spfa));
1932 spfa->
report.overlay_levels = 0;
1933 spfa->
report.overlay_debuginfo_prefix = NULL;
1940 char *nextbufptr = NULL;
1949 while ((token = strtok_r((!token) ? bufptr : NULL,
",",
1952 while (*tptr !=
'\0') {
1963 if (strcmp(token,
"rt") == 0) {
1965 spfa->
report.rt = *token2;
1966 else if (*token2 ==
'i')
1967 spfa->
report.rt = *token2;
1971 else if (strcmp(token,
"tn") == 0) {
1972 spfa->
report.tn = strdup(token2);
1974 else if (strcmp(token,
"tid") == 0) {
1976 spfa->
report.tid = strtol(token2,NULL,0);
1980 else if (strcmp(token,
"rv") == 0) {
1981 spfa->
report.rv = strdup(token2);
1983 else if (strcmp(token,
"msg") == 0) {
1984 if (*token2 !=
'"') {
1985 spfa->
report.msg = malloc(2+1+strlen(token2));
1986 snprintf(spfa->
report.msg,2+1+strlen(token2),
1990 spfa->
report.msg = strdup(token2);
1992 else if (strcmp(token,
"ttctx") == 0) {
1993 if (strcmp(token2,
"none") == 0)
1995 else if (strcmp(token2,
"self") == 0)
1997 else if (strcmp(token2,
"hier") == 0)
1999 else if (strcmp(token2,
"all") == 0)
2004 else if (strcmp(token,
"ttdetail") == 0) {
2005 spfa->
report.ttdetail = atoi(token2);
2007 else if (strcmp(token,
"bt") == 0) {
2008 spfa->
report.bt = atoi(token2);
2010 else if (strcmp(token,
"overlay_levels") == 0) {
2011 spfa->
report.overlay_levels = atoi(token2);
2013 else if (strcmp(token,
"overlay_debuginfo_root_prefix") == 0) {
2014 spfa->
report.overlay_debuginfo_prefix =
2020 bufptr = nextbufptr;
2025 else if (strcmp(token,
"exit") == 0) {
2027 while (*bufptr ==
'-' || isdigit(*bufptr)) ++bufptr;
2033 numval = strtol(token,NULL,0);
2037 spfa = calloc(1,
sizeof(*spfa));
2039 spfa->
exit.retval = numval;
2044 else if (strcmp(token,
"enable") == 0) {
2046 while (isalnum(*bufptr) || *bufptr ==
'_') ++bufptr;
2051 spfa = calloc(1,
sizeof(*spfa));
2053 spfa->
enable.id = strdup(token);
2058 else if (strcmp(token,
"disable") == 0) {
2060 while (isalnum(*bufptr) || *bufptr ==
'_') ++bufptr;
2065 spfa = calloc(1,
sizeof(*spfa));
2067 spfa->
disable.id = strdup(token);
2072 else if (strcmp(token,
"remove") == 0) {
2074 while (isalnum(*bufptr) || *bufptr ==
'_') ++bufptr;
2079 spfa = calloc(1,
sizeof(*spfa));
2081 spfa->
remove.id = strdup(token);
2086 else if (strcmp(token,
"bt") == 0) {
2087 spfa = calloc(1,
sizeof(*spfa));
2092 spfa->
bt.thid = NULL;
2093 spfa->
bt.overlay_levels = 0;
2094 spfa->
bt.overlay_debuginfo_prefix = NULL;
2096 char *nextbufptr = NULL;
2107 while ((token = strtok_r((!token) ? bufptr : NULL,
",",
2110 spfa->
bt.tid = atoi(token);
2112 spfa->
bt.thid = strdup(token);
2114 spfa->
bt.overlay_levels = atoi(token);
2116 spfa->
bt.overlay_debuginfo_prefix = strdup(token);
2122 bufptr = nextbufptr;
2127 else if (strcmp(token,
"signal") == 0) {
2128 spfa = calloc(1,
sizeof(*spfa));
2133 spfa->
signal.thid = NULL;
2135 char *nextbufptr = NULL;
2146 while ((token = strtok_r((!token) ? bufptr : NULL,
",",
2149 spfa->
signal.tid = atoi(token);
2151 spfa->
signal.thid = strdup(token);
2153 spfa->
signal.sigdesc = strdup(token);
2159 bufptr = nextbufptr;
2177 fprintf(stderr,
"ERROR: unknown config directive line %d:\n",lineno);
2178 fprintf(stderr,
"%s\n", buf);
2193 verror(
"parse error at line %d col %d: '%.48s ...'\n",
2194 lineno,(
int)(bufptr - buf),bufptr);
struct target * target_instantiate_overlay(struct target *target, tid_t tid, struct target_spec *spec)
int target_thread_snprintf(struct target *target, tid_t tid, char *buf, int bufsiz, int detail, char *sep, char *kvsep)
struct action * action_return(REGVAL retval)
result_t pre_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
void spf_backtrace(struct target *t, tid_t ctid, char *tiddesc, int overlay_levels, char *overlay_debuginfo_prefix)
struct probe * probe_value_symbol(struct target *target, tid_t tid, struct bsymbol *bsymbol, probe_handler_t pre_handler, probe_handler_t post_handler, void *handler_data)
int probe_unregister(struct probe *probe, int force)
void reload_config_file(void)
void target_monitor_schedule_global_interrupt(void)
int value_snprintf(struct value *value, char *buf, int buflen)
int use_os_syscall_probes
target_personality_t personality
void * target_argp_driver_state(struct argp_state *state)
struct target_nv_filter * ttf
int target_unwind_snprintf(char *buf, int buflen, struct target *target, tid_t tid, target_unwind_style_t fstyle, char *frame_sep, char *ksep)
struct spf_config * load_config_file(char *file)
result_t handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
struct bsymbol * target_lookup_sym(struct target *target, const char *name, const char *delim, char *srcfile, symbol_type_flag_t ftype)
int target_monitor_evloop(struct evloop *evloop, struct timeval *timeout, struct target **target, target_status_t *status)
void print_thread_context(FILE *stream, struct target *target, tid_t tid, int ttctx, int ttdetail, int bt, char *sep, char *kvsep, char *tprefix, char *tsep)
REFCNT action_release(struct action *action)
#define v_g_slist_foreach(gslhead, gslcur, elm)
int target_resume(struct target *target)
struct overlay_spec ** ospecs
#define v_g_list_foreach(glhead, glcur, elm)
result_t null_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
int target_pause(struct target *target)
#define PROBE_VALUE_NAME_RETURN
tid_t target_gettid(struct target *target)
struct argp_option spf_argp_opts[]
struct probe * probe_create_filtered(struct target *target, tid_t tid, struct probe_ops *pops, const char *name, probe_handler_t pre_handler, struct target_nv_filter *pre_filter, probe_handler_t post_handler, struct target_nv_filter *post_filter, struct target_nv_filter *thread_filter, void *handler_data, int autofree, int tracked)
GHashTable * probe_value_get_table(struct probe *probe, tid_t tid)
result_t probe_do_sink_post_handlers(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
struct spf_action::@30::@38 remove
struct target_os_syscall * target_os_syscall_lookup_name(struct target *target, char *name)
int target_close(struct target *target)
struct spf_action::@30::@32 report
#define verror(format,...)
result_t probe_do_sink_pre_handlers(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
int target_install_custom_sighandlers(sigset_t *ignored, sigset_t *interrupt, sigset_t *exit, void(*sighandler)(int signo, siginfo_t *siginfo, void *x))
char * _get_next_non_enc_esc(char *s, int c)
struct spf_action::@30::@33 print
#define vwarn(format,...)
REGVAL target_read_reg(struct target *target, tid_t tid, REG reg)
void spf_filter_free(struct spf_filter *spff)
struct spf_action::@30::@36 enable
struct probe * probe_register_source(struct probe *sink, struct probe *src)
error_t spf_argp_parse_opt(int key, char *arg, struct argp_state *state)
struct target_nv_filter * pf
#define array_list_foreach(alist, lpc, placeholder)
void target_monitor_clear_global_interrupt(void)
void spf_config_free(struct spf_config *config)
void target_default_cleanup()
struct spf_action::@30::@35 exit
REFCNT bsymbol_release(struct bsymbol *bsymbol)
int target_argp_driver_parse(struct argp *driver_parser, void *driver_state, int argc, char **argv, target_type_t target_types, int filter_quoted, struct target_spec **primary_target_spec, GList **base_target_specs, GList **overlay_target_specs)
int target_monitor_was_interrupted(siginfo_t *last_siginfo)
struct array_list * target_list_tids(struct target *target)
int target_os_syscall_table_load(struct target *target)
struct probe * target_os_syscall_probe(struct target *target, tid_t tid, struct target_os_syscall *syscall, probe_handler_t pre_handler, probe_handler_t post_handler, void *handler_data)
int probe_free(struct probe *probe, int force)
struct dt_argp_state opts
int symbol_type_flags_match(struct symbol *symbol, symbol_type_flag_t flags)
int main(int argc, char **argv)
struct target_spec * target_build_default_overlay_spec(struct target *target, tid_t tid)
char * target_name(struct target *target)
struct spf_action::@30::@37 disable
int probe_enable(struct probe *probe)
#define SPF_CONFIGFILE_FATAL
struct spf_action::@30::@34 abort
#define vdebug(devel, areas, flags, format,...)
#define SPF_OS_SYSCALL_PROBES
int apply_config_file(struct spf_config *config)
struct array_list * target_list_available_tids(struct target *target)
int evloop_maxsize(struct evloop *evloop)
struct target_nv_filter * target_nv_filter_parse(char *expr)
result_t post_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
int target_os_signal_from_name(struct target *target, const char *name)
int probe_disable(struct probe *probe)
struct evloop * evloop_create(evloop_error_handler_t ehandler)
struct target * target_lookup_target_id(int id)
int target_finalize(struct target *target)
struct symbol * bsymbol_get_symbol(struct bsymbol *bsymbol)
void target_nv_filter_free(struct target_nv_filter *pf)
#define vwarnc(format,...)
char * base_thread_name_or_id
GList * target_instantiate_and_open(struct target_spec *primary_target_spec, GList *base_target_specs, GList *overlay_target_specs, struct evloop *evloop, GList **error_specs)
int target_open(struct target *target)
void sigh_cleanup_probes(int signo, siginfo_t *siginfo, void *x)
int spf_signal(struct target *t, tid_t ctid, char *tiddesc, char *sigdesc)
char * overlay_debuginfo_prefix
char * symbol_get_name(struct symbol *symbol)
char * debugfile_root_prefix
struct target_thread * target_lookup_thread(struct target *target, tid_t tid)
#define array_list_foreach_fakeptr_t(alist, lpc, placeholder, intertype)
struct spf_action::@30::@40 signal
char * probe_name(struct probe *probe)
void spf_action_free(struct spf_action *spfa)
int target_os_signal_enqueue(struct target *target, tid_t tid, int signo, void *data)
struct target_spec * spec
int action_sched(struct probe *probe, struct action *action, action_whence_t whence, action_handler_t handler, void *handler_data)
struct memregion * region
void target_driver_argp_init_children(struct argp_state *state)
struct spf_config * config