From b642c901a918a92fdd6b1167ed02dfe4c50cdd3e Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Fri, 26 Mar 2010 17:14:32 -0400 Subject: Add kprobe user probe semaphore handling. Adds stap_kprobe_process_found and stap_kprobe_mmap_found handlers and then the task_finder uses those to set the semaphore values. The probe adds user_path and user_lib which are used by the task_finder to decide what object to sniff. * sdt.h (STAP_SEMAPHORE): Also define for kprobes. * tapsets.cxx (dwarf_derived_probe): Add user_path and user_lib. (dwarf_derived_probe::join_group): Enable task finder for kprobes. (dwarf_derived_probe::dwarf_derived_probe): Set user_path and user_lib. (dwarf_derived_probe_group::emit_module_decls): Emit stap_kprobe_mmap_found, sdt_sem_offset, sdt_sem_address, pathname, and finder declarations. Emit stap_kprobe_process_found and stap_kprobe_mmap_found. (dwarf_derived_probe_group::emit_module_init): Setup task finder. (sdt_query::convert_location): Remove TOK_LIBRARY token. (dwarf_builder::build): Set user_path and user_lib. (kprobe_derived_probe): Add path and library. (kprobe_builder::build): Get process and library params --- includes/sys/sdt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'includes/sys/sdt.h') diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h index 39ebfb50..74906783 100644 --- a/includes/sys/sdt.h +++ b/includes/sys/sdt.h @@ -29,12 +29,12 @@ #define STAP_PROBE_DATA_(probe,guard,arg) \ __asm__ volatile (".section .probes," ALLOCSEC "\n" \ "\t.balign 8\n" \ - "1:\n\t.asciz " #probe "\n" \ - "\t.balign 4\n" \ + "1:\n\t.asciz " #probe "\n" \ + "\t.balign 4\n" \ "\t.int " #guard "\n" \ "\t.balign 8\n" \ - STAP_PROBE_ADDR("1b\n") \ - "\t.balign 8\n" \ + STAP_PROBE_ADDR("1b\n") \ + "\t.balign 8\n" \ STAP_PROBE_ADDR(#arg "\n") \ "\t.int 0\n" \ "\t.previous\n") @@ -42,7 +42,7 @@ #define STAP_PROBE_DATA(probe, guard, arg) \ STAP_PROBE_DATA_(#probe,guard,arg) -#if defined STAP_HAS_SEMAPHORES && ! defined EXPERIMENTAL_KPROBE_SDT +#if defined STAP_HAS_SEMAPHORES #define STAP_SEMAPHORE(probe) \ if (__builtin_expect ( probe ## _semaphore , 0)) #else -- cgit