diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-01-24 23:48:06 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-01-24 23:48:06 -0500 |
commit | a1732c4f7856621604a1cc45a29af618aaa502e0 (patch) | |
tree | 29e3f9c4405e1fd1f81b8c87ac2e485855541a66 /runtime/staprun/symbols.c | |
parent | 7ee3e80ec0b7880c33d0ca3018025855d9dd5123 (diff) | |
parent | 674427d3a018d0f89c9669db8dcf952aab8b4423 (diff) | |
download | systemtap-steved-a1732c4f7856621604a1cc45a29af618aaa502e0.tar.gz systemtap-steved-a1732c4f7856621604a1cc45a29af618aaa502e0.tar.xz systemtap-steved-a1732c4f7856621604a1cc45a29af618aaa502e0.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun/symbols.c')
-rw-r--r-- | runtime/staprun/symbols.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/runtime/staprun/symbols.c b/runtime/staprun/symbols.c index 5a4855b3..e33ee624 100644 --- a/runtime/staprun/symbols.c +++ b/runtime/staprun/symbols.c @@ -12,9 +12,8 @@ #include "staprun.h" /* send symbol data */ -static int send_data(void *data, int len) +static int send_data(int32_t type, void *data, int len) { - int32_t type = STP_SYMBOLS; if (write(control_channel, &type, 4) <= 0) return -1; return write(control_channel, data, len); @@ -158,11 +157,9 @@ static int send_module (char *mname) { char data[65536]; int len; - *(int32_t *)data = STP_MODULE; - len = get_sections(mname, data + sizeof(int32_t), - sizeof(data) - sizeof(int32_t)); + len = get_sections(mname, data, sizeof(data)); if (len > 0) { - if (write(control_channel, data, len + sizeof(int32_t)) <= 0) { + if (send_data(STP_MODULE, data, len) < 0) { _err("Loading of module %s failed. Exiting...\n", mname); return -1; } @@ -296,11 +293,11 @@ int do_kernel_symbols(void) goto err; /* send syms */ - if (send_data(syms, num_syms*struct_symbol_size) < 0) + if (send_data(STP_SYMBOLS, syms, num_syms*struct_symbol_size) < 0) goto err; /* send data */ - if (send_data(data_base, dataptr-data_base) < 0) + if (send_data(STP_SYMBOLS, data_base, dataptr-data_base) < 0) goto err; free(data_base); |