/
usr
/
share
/
systemtap
/
runtime
/
linux
/
/usr/share/systemtap/runtime/linux
mkdir
upload
Name
Size
Mode
Actions
uprobes/
-
0755
rm
uprobes2/
-
0755
rm
access_process_vm.h
4311
0644
edit
dl
rm
addr-map.c
9749
0644
edit
dl
rm
alloc.c
15900
0644
edit
dl
rm
arith.c
16799
0644
edit
dl
rm
autoconf-514-panic.c
68
0644
edit
dl
rm
autoconf-access_ok_2args.c
90
0644
edit
dl
rm
autoconf-alloc-percpu-align.c
118
0644
edit
dl
rm
autoconf-asm-syscall.c
51
0644
edit
dl
rm
autoconf-atomic_fetch_add_unless.c
94
0644
edit
dl
rm
autoconf-bio-bi_opf.c
824
0644
edit
dl
rm
autoconf-blk-types.c
359
0644
edit
dl
rm
autoconf-compat-utimbuf.c
53
0644
edit
dl
rm
autoconf-compat_sigaction.c
448
0644
edit
dl
rm
autoconf-constant-tsc.c
63
0644
edit
dl
rm
autoconf-cpu-clock.c
1277
0644
edit
dl
rm
autoconf-dpath-path.c
121
0644
edit
dl
rm
autoconf-files_lookup_fd_raw.c
136
0644
edit
dl
rm
autoconf-from_kuid_munged.c
191
0644
edit
dl
rm
autoconf-fs_supers-hlist.c
354
0644
edit
dl
rm
autoconf-generated-compile.c
56
0644
edit
dl
rm
autoconf-genhd.c
201
0644
edit
dl
rm
autoconf-get-kretprobe.c
107
0644
edit
dl
rm
autoconf-get_user_pages-flags.c
1549
0644
edit
dl
rm
autoconf-get_user_pages-notask_struct.c
1301
0644
edit
dl
rm
autoconf-get_user_pages_remote-flags.c
1550
0644
edit
dl
rm
autoconf-get_user_pages_remote-flags_locked.c
1331
0644
edit
dl
rm
autoconf-get_user_pages_remote-notask_struct.c
1438
0644
edit
dl
rm
autoconf-grsecurity.c
219
0644
edit
dl
rm
autoconf-hlist-4args.c
296
0644
edit
dl
rm
autoconf-hlist_add_tail_rcu.c
112
0644
edit
dl
rm
autoconf-hrtimer-getset-expires.c
126
0644
edit
dl
rm
autoconf-hrtimer-rel.c
87
0644
edit
dl
rm
autoconf-hw_breakpoint_context.c
315
0644
edit
dl
rm
autoconf-inode-private.c
173
0644
edit
dl
rm
autoconf-inode-rwsem.c
172
0644
edit
dl
rm
autoconf-inode-uretprobes.c
264
0644
edit
dl
rm
autoconf-kernel_read-new-args.c
1030
0644
edit
dl
rm
autoconf-kprobe-symbol-name.c
90
0644
edit
dl
rm
autoconf-ktime-get-real.c
98
0644
edit
dl
rm
autoconf-linux-sched_headers.c
1678
0644
edit
dl
rm
autoconf-local-clock.c
1282
0644
edit
dl
rm
autoconf-lockdown-debugfs.c
102
0644
edit
dl
rm
autoconf-lockdown-kernel.c
90
0644
edit
dl
rm
autoconf-mm-context-vdso-base.c
117
0644
edit
dl
rm
autoconf-mm-context-vdso.c
114
0644
edit
dl
rm
autoconf-mm-shmempages.c
72
0644
edit
dl
rm
autoconf-mmap_lock.c
175
0644
edit
dl
rm
autoconf-module-sect-attrs.c
158
0644
edit
dl
rm
autoconf-module_layout.c
52
0644
edit
dl
rm
autoconf-mod_kallsyms.c
51
0644
edit
dl
rm
autoconf-nameidata.c
96
0644
edit
dl
rm
autoconf-netfilter-4_1.c
769
0644
edit
dl
rm
autoconf-netfilter-4_4.c
1460
0644
edit
dl
rm
autoconf-netfilter-313b.c
602
0644
edit
dl
rm
autoconf-netfilter.c
422
0644
edit
dl
rm
autoconf-old-inode-uprobes.c
357
0644
edit
dl
rm
autoconf-oneachcpu-retry.c
957
0644
edit
dl
rm
autoconf-pagefault_disable.c
137
0644
edit
dl
rm
autoconf-pde_data.c
226
0644
edit
dl
rm
autoconf-perf-structpid.c
444
0644
edit
dl
rm
autoconf-procfs-owner.c
158
0644
edit
dl
rm
autoconf-proc_ops.c
566
0644
edit
dl
rm
autoconf-rcu_is_watching.c
385
0644
edit
dl
rm
autoconf-real-parent.c
427
0644
edit
dl
rm
autoconf-regset.c
239
0644
edit
dl
rm
autoconf-relay-umode_t.c
730
0644
edit
dl
rm
autoconf-relay_buf-per_cpu_ptr.c
920
0644
edit
dl
rm
autoconf-ring_buffer-flags.c
112
0644
edit
dl
rm
autoconf-ring_buffer_lost_events.c
296
0644
edit
dl
rm
autoconf-ring_buffer_read_prepare.c
181
0644
edit
dl
rm
autoconf-save-stack-trace-no-bp.c
498
0644
edit
dl
rm
autoconf-save-stack-trace.c
501
0644
edit
dl
rm
autoconf-set_fs.c
221
0644
edit
dl
rm
autoconf-smpcall-4args.c
166
0644
edit
dl
rm
autoconf-smpcall-5args.c
169
0644
edit
dl
rm
autoconf-stack-trace-save-regs.c
176
0644
edit
dl
rm
autoconf-stacktrace_ops-int-address.c
409
0644
edit
dl
rm
autoconf-stacktrace_ops-warning.c
188
0644
edit
dl
rm
autoconf-syscall_get_args_3args.c
239
0644
edit
dl
rm
autoconf-task-state.c
550
0644
edit
dl
rm
autoconf-task-uid.c
152
0644
edit
dl
rm
autoconf-task_work-struct.c
219
0644
edit
dl
rm
autoconf-time32-old.c
52
0644
edit
dl
rm
autoconf-time32.c
53
0644
edit
dl
rm
autoconf-timerfd.c
232
0644
edit
dl
rm
autoconf-trace-printk.c
151
0644
edit
dl
rm
autoconf-tracepoint-has-data.c
493
0644
edit
dl
rm
autoconf-tracepoint-strings.c
233
0644
edit
dl
rm
autoconf-uaccess.c
28
0644
edit
dl
rm
autoconf-uapi-mount.c
52
0644
edit
dl
rm
autoconf-udelay_simple.c
90
0644
edit
dl
rm
autoconf-uidgid.c
50
0644
edit
dl
rm
autoconf-unwind-stack-trace.c
326
0644
edit
dl
rm
autoconf-uprobe-get-pc.c
374
0644
edit
dl
rm
autoconf-utrace-regset.c
273
0644
edit
dl
rm
autoconf-utrace-via-tracepoints.c
1712
0644
edit
dl
rm
autoconf-vm-area-pte.c
141
0644
edit
dl
rm
autoconf-walk-stack.c
217
0644
edit
dl
rm
autoconf-x86-fs.c
90
0644
edit
dl
rm
autoconf-x86-gs.c
90
0644
edit
dl
rm
autoconf-x86-uniregs.c
140
0644
edit
dl
rm
autoconf-x86-xfs.c
91
0644
edit
dl
rm
common_session_state.h
3249
0644
edit
dl
rm
compat_net.h
858
0644
edit
dl
rm
compat_structs.h
4409
0644
edit
dl
rm
compat_unistd.h
68384
0644
edit
dl
rm
copy.c
2717
0644
edit
dl
rm
debug.h
2978
0644
edit
dl
rm
io.c
5291
0644
edit
dl
rm
itrace.c
14874
0644
edit
dl
rm
kprobes.c
25126
0644
edit
dl
rm
loc2c-runtime.h
29874
0644
edit
dl
rm
map_list.h
1220
0644
edit
dl
rm
map_runtime.h
5266
0644
edit
dl
rm
namespaces.h
7128
0644
edit
dl
rm
netfilter.c
1410
0644
edit
dl
rm
perf.c
7596
0644
edit
dl
rm
perf.h
1272
0644
edit
dl
rm
perf_event_counter_context.c
336
0644
edit
dl
rm
perf_probe_handler_nmi.c
278
0644
edit
dl
rm
perf_read.h
959
0644
edit
dl
rm
print.c
11402
0644
edit
dl
rm
probe_lock.h
1807
0644
edit
dl
rm
regs-ia64.c
3741
0644
edit
dl
rm
regs.c
13490
0644
edit
dl
rm
runtime.h
12591
0644
edit
dl
rm
runtime_context.h
6089
0644
edit
dl
rm
runtime_defines.h
1041
0644
edit
dl
rm
stap_mmap_lock.h
343
0644
edit
dl
rm
stat_runtime.h
1774
0644
edit
dl
rm
stp_tls.h
1181
0644
edit
dl
rm
stp_tracepoint.c
11481
0644
edit
dl
rm
stp_tracepoint.h
2270
0644
edit
dl
rm
syscalls-common.h
976
0644
edit
dl
rm
task_finder.c
53860
0644
edit
dl
rm
task_finder2.c
57640
0644
edit
dl
rm
task_finder_map.c
5194
0644
edit
dl
rm
task_finder_stubs.c
2442
0644
edit
dl
rm
task_work_compatibility.h
1283
0644
edit
dl
rm
timer.c
2200
0644
edit
dl
rm
timer.h
1383
0644
edit
dl
rm
timer_compatibility.h
2317
0644
edit
dl
rm
uprobes-common.c
15573
0644
edit
dl
rm
uprobes-common.h
1653
0644
edit
dl
rm
uprobes-inc.h
484
0644
edit
dl
rm
uprobes-inode.c
34086
0644
edit
dl
rm
Edit:
/usr/share/systemtap/runtime/linux/task_finder_map.c
(5194B)
#include <linux/list.h> #include <linux/jhash.h> #include "stp_helper_lock.h" // When handling mmap()/munmap()/mprotect() syscall tracing to notice // memory map changes, we need to cache syscall entry parameter values // for processing at syscall exit. // __stp_tf_map_lock protects the hash table. // Documentation/spinlocks.txt suggest we can be a bit more clever // if we guarantee that in interrupt context we only read, not write // the datastructures. We should never change the hash table or the // contents in interrupt context (which should only ever call // stap_find_map_map_info for getting stored info). So we might // want to look into that if this seems a bottleneck. static STP_DEFINE_RWLOCK(__stp_tf_map_lock); #define __STP_TF_HASH_BITS 4 #define __STP_TF_TABLE_SIZE (1 << __STP_TF_HASH_BITS) #ifndef TASK_FINDER_MAP_ENTRY_ITEMS #define TASK_FINDER_MAP_ENTRY_ITEMS 100 #endif struct __stp_tf_map_entry { /* private: */ struct hlist_node hlist; int usage; /* public: */ pid_t pid; long syscall_no; unsigned long arg0; unsigned long arg1; unsigned long arg2; }; static struct __stp_tf_map_entry __stp_tf_map_free_list_items[TASK_FINDER_MAP_ENTRY_ITEMS]; static struct hlist_head __stp_tf_map_free_list[1]; static struct hlist_head __stp_tf_map_table[__STP_TF_TABLE_SIZE]; // __stp_tf_map_initialize(): Initialize the free list. Grabs the // lock. static void __stp_tf_map_initialize(void) { int i; struct hlist_head *head = &__stp_tf_map_free_list[0]; unsigned long flags; stp_write_lock_irqsave(&__stp_tf_map_lock, flags); for (i = 0; i < TASK_FINDER_MAP_ENTRY_ITEMS; i++) { hlist_add_head(&__stp_tf_map_free_list_items[i].hlist, head); } stp_write_unlock_irqrestore(&__stp_tf_map_lock, flags); } // __stp_tf_map_get_free_entry(): Returns an entry from the free list // or NULL. The __stp_tf_map_lock must be write locked before calling this // function. static struct __stp_tf_map_entry * __stp_tf_map_get_free_entry(void) { struct hlist_head *head = &__stp_tf_map_free_list[0]; struct hlist_node *node; struct __stp_tf_map_entry *entry = NULL; if (hlist_empty(head)) return NULL; stap_hlist_for_each_entry(entry, node, head, hlist) { break; } if (entry != NULL) hlist_del(&entry->hlist); return entry; } // __stp_tf_map_put_free_entry(): Puts an entry back on the free // list. The __stp_tf_map_lock must be write locked before calling this // function. static void __stp_tf_map_put_free_entry(struct __stp_tf_map_entry *entry) { struct hlist_head *head = &__stp_tf_map_free_list[0]; hlist_add_head(&entry->hlist, head); } // __stp_tf_map_hash(): Compute the map hash. static inline u32 __stp_tf_map_hash(struct task_struct *tsk) { return (jhash_1word(tsk->pid, 0) & (__STP_TF_TABLE_SIZE - 1)); } // Get map_entry if the map is present in the map hash table. // Returns NULL if not present. Takes a read lock on __stp_tf_map_lock. static struct __stp_tf_map_entry * __stp_tf_get_map_entry(struct task_struct *tsk) { struct hlist_head *head; struct hlist_node *node; struct __stp_tf_map_entry *entry; unsigned long flags; stp_read_lock_irqsave(&__stp_tf_map_lock, flags); head = &__stp_tf_map_table[__stp_tf_map_hash(tsk)]; stap_hlist_for_each_entry(entry, node, head, hlist) { if (tsk->pid == entry->pid) { stp_read_unlock_irqrestore(&__stp_tf_map_lock, flags); return entry; } } stp_read_unlock_irqrestore(&__stp_tf_map_lock, flags); return NULL; } // Add the map info to the map hash table. Takes a write lock on // __stp_tf_map_lock. static int __stp_tf_add_map(struct task_struct *tsk, long syscall_no, unsigned long arg0, unsigned long arg1, unsigned long arg2) { struct hlist_head *head; struct hlist_node *node; struct __stp_tf_map_entry *entry; unsigned long flags; stp_write_lock_irqsave(&__stp_tf_map_lock, flags); head = &__stp_tf_map_table[__stp_tf_map_hash(tsk)]; stap_hlist_for_each_entry(entry, node, head, hlist) { // If we find an existing entry, just increment the // usage count. if (tsk->pid == entry->pid) { entry->usage++; stp_write_unlock_irqrestore(&__stp_tf_map_lock, flags); return 0; } } // Get an element from the free list. entry = __stp_tf_map_get_free_entry(); if (!entry) { stp_write_unlock_irqrestore(&__stp_tf_map_lock, flags); return -ENOMEM; } entry->usage = 1; entry->pid = tsk->pid; entry->syscall_no = syscall_no; entry->arg0 = arg0; entry->arg1 = arg1; entry->arg2 = arg2; hlist_add_head(&entry->hlist, head); stp_write_unlock_irqrestore(&__stp_tf_map_lock, flags); return 0; } // Remove the map entry from the map hash table. Takes a write lock on // __stp_tf_map_lock. static int __stp_tf_remove_map_entry(struct __stp_tf_map_entry *entry) { struct hlist_head *head; struct hlist_node *node; int found = 0; if (entry != NULL) { unsigned long flags; stp_write_lock_irqsave(&__stp_tf_map_lock, flags); // Decrement the usage count. entry->usage--; // If the entry is unused, put it back on the free // list. if (entry->usage == 0) { hlist_del(&entry->hlist); __stp_tf_map_put_free_entry(entry); } stp_write_unlock_irqrestore(&__stp_tf_map_lock, flags); } return 0; }
Save
cmd:
run