diff options
Diffstat (limited to 'runtime/probes/test4')
-rw-r--r-- | runtime/probes/test4/README | 10 | ||||
-rw-r--r-- | runtime/probes/test4/dtr.c | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/runtime/probes/test4/README b/runtime/probes/test4/README index 20a1ad23..75d4be10 100644 --- a/runtime/probes/test4/README +++ b/runtime/probes/test4/README @@ -1,7 +1,9 @@ -Sample probe. - -This is a translation of on an old dtr probe: +/** @dir test4 +This example probe tracks file opens, reads and writes. +It demonstrates maps, stats, and iterators. +This is a translation of on an old dtr probe. Original source is +\verbatim global { long @opens[string]; sum @reads[string], @writes[string]; @@ -18,3 +20,5 @@ probe sys_read:entry { probe sys_write:entry { @writes[current->comm] << count; } +\endverbatim +*/ diff --git a/runtime/probes/test4/dtr.c b/runtime/probes/test4/dtr.c index 1c8d8f05..8c6257e2 100644 --- a/runtime/probes/test4/dtr.c +++ b/runtime/probes/test4/dtr.c @@ -15,7 +15,7 @@ MAP opens, reads, writes; asmlinkage long inst_sys_open (const char __user * filename, int flags, int mode) { _stp_map_key_str (opens, current->comm); - _stp_map_set_int64 (opens, _stp_map_get_int64(opens) + 1); + _stp_map_add_int64 (opens, 1); jprobe_return(); return 0; } |