#ifndef _PROBE_FINDER_H
#define _PROBE_FINDER_H
-#define _stringify(n) #n
-#define stringify(n) _stringify(n)
-
-#ifdef DEBUG
-#define debug(fmt ...) \
- fprintf(stderr, "DBG(" __FILE__ ":" stringify(__LINE__) "): " fmt)
-#else
-#define debug(fmt ...) do {} while (0)
-#endif
-
-#define ERR_IF(cnd) \
- do { if (cnd) { \
- fprintf(stderr, "Error (" __FILE__ ":" stringify(__LINE__) \
- "): " stringify(cnd) "\n"); \
- exit(1); \
- } } while (0)
-
#define MAX_PATH_LEN 256
#define MAX_PROBE_BUFFER 1024
#define MAX_PROBES 128
}
struct probe_point {
+ char *event; /* Event name */
+ char *group; /* Event group */
+
/* Inputs */
char *file; /* File name */
int line; /* Line number */
int nr_args; /* Number of arguments */
char **args; /* Arguments */
+ int retprobe; /* Return probe */
+
/* Output */
int found; /* Number of found probe points */
char *probes[MAX_PROBES]; /* Output buffers (will be allocated)*/
};
+#ifndef NO_LIBDWARF
extern int find_probepoint(int fd, struct probe_point *pp);
#include <libdwarf/dwarf.h>
/* For function searching */
Dwarf_Addr addr; /* Address */
Dwarf_Unsigned fno; /* File number */
+ Dwarf_Unsigned lno; /* Line number */
Dwarf_Off inl_offs; /* Inline offset */
+ Dwarf_Die cu_die; /* Current CU */
/* For variable searching */
Dwarf_Addr cu_base; /* Current CU base address */
char *buf; /* Current output buffer */
int len; /* Length of output buffer */
};
+#endif /* NO_LIBDWARF */
#endif /*_PROBE_FINDER_H */