summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/staprun_funcs.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-04-13 14:59:36 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-04-13 14:59:36 -0400
commit1ec6761a6b893c2c755753617bebac79b3040fca (patch)
treebd252bb1d5253e1a10ff24b1790e6e0e1b7cec02 /runtime/staprun/staprun_funcs.c
parentbf50bb491c5bfcf3035de45ac58acf11ed02af06 (diff)
parent1c86aa2adc1165906057cdde4cc7484468726fc4 (diff)
downloadsystemtap-steved-1ec6761a6b893c2c755753617bebac79b3040fca.tar.gz
systemtap-steved-1ec6761a6b893c2c755753617bebac79b3040fca.tar.xz
systemtap-steved-1ec6761a6b893c2c755753617bebac79b3040fca.zip
Merge commit 'origin/unwind'
* commit 'origin/unwind': Fixes for 2.6.25 pt_regs changes. Include string.h Change stap to get kernel symbols from debuginfo and reincarnate vim/ directory in this branch to match master Add new define STP_USE_DWARF_UNWINDER which is set based on which archs Remove misleading error message. Support for kernels built with CONFIG_FRAME_POINTER Fix regression. dded _stp_read_address() and changed code to use it. kretprobe trampoline fixes i386 fixes. control.c (_stp_ctl_write_dbug): Insert missing break. 32-bit fixes Cleanup. 2008-03-23 Frank Ch. Eigler <fche@elastic.org> 2008-03-23 Frank Ch. Eigler <fche@elastic.org> 2008-03-21 Eugene Teo <eugeneteo@kernel.sg> add (back) runtime/unwind files * clarify utility of epilogue-type probe aliases in documentation rebased unwind_branch on top of current master
Diffstat (limited to 'runtime/staprun/staprun_funcs.c')
-rw-r--r--runtime/staprun/staprun_funcs.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c
index 34e12c25..b95a9a5a 100644
--- a/runtime/staprun/staprun_funcs.c
+++ b/runtime/staprun/staprun_funcs.c
@@ -401,95 +401,3 @@ int check_permissions(void)
* is in that directory. */
return check_path();
}
-
-pthread_t symbol_thread_id = (pthread_t)0;
-int kernel_ptr_size = 0;
-
-/* Symbol handling thread */
-void *handle_symbols(void __attribute__((unused)) *arg)
-{
- ssize_t nb;
- void *data;
- int32_t type;
- char recvbuf[8192];
-
- dbug(2, "waiting for symbol requests\n");
-
- /* handle messages from control channel */
- while (1) {
- nb = read(control_channel, recvbuf, sizeof(recvbuf));
- if (nb <= 0) {
- if (errno != EINTR)
- _perr("Unexpected EOF in read (nb=%ld)", (long)nb);
- continue;
- }
-
- type = *(int32_t *)recvbuf;
- data = (void *)(recvbuf + sizeof(int32_t));
-
- switch (type) {
- case STP_MODULE:
- {
- dbug(2, "STP_MODULES request received\n");
- if (do_module(data) < 0)
- goto done;
- break;
- }
- case STP_SYMBOLS:
- {
- struct _stp_msg_symbol *req = (struct _stp_msg_symbol *)data;
- dbug(2, "STP_SYMBOLS request received\n");
- if (req->endian != 0x1234) {
- err("ERROR: staprun is compiled with different endianess than the kernel!\n");
- goto done;
- }
- kernel_ptr_size = req->ptr_size;
- if (kernel_ptr_size != 4 && kernel_ptr_size != 8) {
- err("ERROR: invalid kernel pointer size %d\n", kernel_ptr_size);
- goto done;
- }
- if (do_kernel_symbols() < 0)
- goto done;
- break;
- }
- default:
- err("WARNING: ignored message of type %d\n", (type));
- }
- }
-
-done:
- /* signal stapio we're done */
- kill(0, SIGINT);
-
- return NULL;
-}
-
-void start_symbol_thread(void)
-{
- int status;
-
- /* create symbol control channel */
- status = do_cap(CAP_DAC_OVERRIDE, init_ctl_channel, 1);
- drop_cap(CAP_DAC_OVERRIDE);
- if (status < 0) {
- err("Failed to initialize control channel.\n");
- exit(1);
- }
- status = pthread_create(&symbol_thread_id, NULL, handle_symbols, NULL);
- if (status) {
- perr("Failed to create symbol thread.\n");
- exit(1);
- }
-}
-
-void stop_symbol_thread(void)
-{
-
- if (symbol_thread_id) {
- dbug(2, "Stopping symbol thread.\n");
- pthread_cancel(symbol_thread_id);
- pthread_join(symbol_thread_id, NULL);
- }
- close_ctl_channel();
-}
-