From 2972246a08bfc7c516455ecc4ef976e10c0ddb2c Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 12 Oct 2007 19:42:32 +0000 Subject: 2007-10-12 Martin Hunt Changes to separate the symbols from the command channel. * cap.c (init_cap): Add CAP_DAC_OVERRIDE. * staprun.h: Change init_ctl_channel prototype. * ctl.c (init_ctl_channel): Modify to open either a command or symbol channel. Use ".cmd" and ".symbols" as the new names. * mainloop.c (init_stapio): Call init_ctl_channel(0); * staprun.c (cleanup): Call stop_symbol_thread(). (main): Call start_symbol_thread(). * staprun_funcs.c (handle_symbols): Make a thread. (start_symbol_thread): New. (stop_symbol_thread): New. --- runtime/staprun/symbols.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'runtime/staprun/symbols.c') diff --git a/runtime/staprun/symbols.c b/runtime/staprun/symbols.c index 61b56b2e..315362fa 100644 --- a/runtime/staprun/symbols.c +++ b/runtime/staprun/symbols.c @@ -140,7 +140,10 @@ err0: } #undef SECDIR -void send_module (char *mname) +/* + * For modules, we send the name, section names, and offsets + */ +static void send_module (char *mname) { char data[32768]; int len = get_sections(mname, data, sizeof(data)); @@ -152,6 +155,9 @@ void send_module (char *mname) } } +/* + * Send either all modules, or a specific one. + */ int do_module (void *data) { struct _stp_module *mod = (struct _stp_module *)data; @@ -183,6 +189,11 @@ static int compar(const void *p1, const void *p2) #define MAX_SYMBOLS 32*1024 +/* + * Read /proc/kallsyms and send all kernel symbols to the + * systemtap module. Ignore module symbols; the systemtap module + * can access them directly. + */ void do_kernel_symbols(void) { FILE *kallsyms=NULL; -- cgit