From 5f1af961c261c83fa79ae656a2e14c08b1194596 Mon Sep 17 00:00:00 2001 From: Prerna Saxena Date: Fri, 13 Nov 2009 15:55:26 +0530 Subject: Adding a new .meta file to run interrupts-by-dev.stp in test --- .../systemtap.examples/interrupt/interrupts-by-dev.meta | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 testsuite/systemtap.examples/interrupt/interrupts-by-dev.meta diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.meta b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.meta new file mode 100644 index 00000000..a89038b4 --- /dev/null +++ b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.meta @@ -0,0 +1,14 @@ +title: Record interrupts on a per-device basis. +name: interrupts-by-dev.stp +version: 1.0 +author: Prerna Saxena (prerna@linux.vnet.ibm.com) +keywords: interrupt +subsystem: interrupt +status: production +exit: user-controlled +output: timed +scope: system-wide +description: The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms. +test_support: stap -l 'kernel.trace("irq_handler_entry")' +test_check: stap -p4 interrupts-by-dev.stp +test_installcheck: stap interrupts-by-dev.stp -c "sleep 0.2" -- cgit From f6ac00e8c648759ac70f290b90c4f369e72dd623 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Nov 2009 13:39:24 +0100 Subject: Accept relative user module paths for -d. When using relative (non-canonical) paths for user modules one would get a confusing WARNING: missing unwind/symbol data for module 'bin/test'. Also unless the path started with '/' the task_finder wouldn't start. By checking that the given file can be made absolute (canonicalized) both issues are resolved and the user module will be correctly identified at both translation and runtime. * main.cxx (main): case 'd' try canonicalize_file_name() the argument first to identify user modules. --- main.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main.cxx b/main.cxx index 165b51c2..71c70df8 100644 --- a/main.cxx +++ b/main.cxx @@ -676,11 +676,19 @@ main (int argc, char * const argv []) break; case 'd': - s.unwindsym_modules.insert (string (optarg)); - // PR10228: trigger task-finder logic early if -d /USER-MODULE/ given. - if (optarg[0] == '/') - enable_task_finder (s); - break; + { + // At runtime user module names are resolved through their + // canonical (absolute) path. + const char *mpath = canonicalize_file_name (optarg); + if (mpath == NULL) // Must be a kernel module name + mpath = optarg; + s.unwindsym_modules.insert (string (mpath)); + // PR10228: trigger task-finder logic early if -d /USER-MODULE/ + // given. + if (mpath[0] == '/') + enable_task_finder (s); + break; + } case 'e': if (have_script) -- cgit From 4e97adab523667204864f10fef6ad992da49f27e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Nov 2009 14:42:17 +0100 Subject: Turn ctime.stp documentation into proper Tapset Reference markup. * doc/SystemTap_Tapset_Reference/tapsets.tmpl: Add chapter on ctime.stp. * tapset/ctime.stp: Turn documentation into proper reference markup. --- doc/SystemTap_Tapset_Reference/tapsets.tmpl | 10 ++++++++++ tapset/ctime.stp | 27 +++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/tapsets.tmpl b/doc/SystemTap_Tapset_Reference/tapsets.tmpl index c73defef..ff1d50da 100644 --- a/doc/SystemTap_Tapset_Reference/tapsets.tmpl +++ b/doc/SystemTap_Tapset_Reference/tapsets.tmpl @@ -135,6 +135,16 @@ !Itapset/timestamp.stp + + Time string utility function + + Utility function to turn seconds since the epoch (as returned by + the timestamp function gettimeofday_s()) into a human readable + date/time string. + +!Itapset/ctime.stp + + Memory Tapset diff --git a/tapset/ctime.stp b/tapset/ctime.stp index d907c2db..3ecd6ddf 100644 --- a/tapset/ctime.stp +++ b/tapset/ctime.stp @@ -1,7 +1,18 @@ -/* - * ctime() +/* ctime.stp - Convert seconds to human readable date string. * - * Takes an argument of seconds since the epoch as returned by + * This code was adapted from the newlib mktm_r() and asctime_r() + * functions. In newlib, mktm_r.c states that it was adapted from + * tzcode maintained by Arthur David Olson. In newlib, asctime_r.c + * doesn't have any author/copyright information. + * + * Changes copyright (C) 2006, 2008 Red Hat Inc. + */ + +/** + * sfunction ctime - Convert seconds since epoch into human readable date/time string. + * @epochsecs: Number of seconds since epoch (as returned by gettimeofday_s()). + * + * Description: Takes an argument of seconds since the epoch as returned by * gettimeofday_s(). Returns a string of the form * * "Wed Jun 30 21:49:08 1993" @@ -19,7 +30,7 @@ * * The earliest full date given by ctime, corresponding to epochsecs * -2147483648 is "Fri Dec 13 20:45:52 1901". The latest full date - * given by ctime, corresponding to epachsecs 2147483647 is + * given by ctime, corresponding to epochsecs 2147483647 is * "Tue Jan 19 03:14:07 2038". * * The abbreviations for the days of the week are ‘Sun’, ‘Mon’, ‘Tue’, @@ -31,15 +42,7 @@ * character at the end of the string that this function does not. * Also note that since the kernel has no concept of timezones, the * returned time is always in GMT. - * - * This code was adapted from the newlib mktm_r() and asctime_r() - * functions. In newlib, mktm_r.c states that it was adapted from - * tzcode maintained by Arthur David Olson. In newlib, asctime_r.c - * doesn't have any author/copyright information. - * - * Changes copyright (C) 2006, 2008 Red Hat Inc. */ - function ctime:string(epochsecs:long) %{ /* pure */ -- cgit From 3b605aebad464a18c9cac6ec4f5fa96ca8dbe560 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Nov 2009 15:20:16 -0800 Subject: Delete test commit file --- doc/test | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/test diff --git a/doc/test b/doc/test deleted file mode 100644 index eefc69f7..00000000 --- a/doc/test +++ /dev/null @@ -1 +0,0 @@ -Thu Aug 28 23:10:00 EST 2008 -- cgit From 6b95efe9fd58e1884baa7ec14de68996e88e0868 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 13 Nov 2009 15:21:06 -0800 Subject: Regen indexes for interrupts-by-dev example --- testsuite/systemtap.examples/index.html | 3 +++ testsuite/systemtap.examples/index.txt | 7 +++++++ testsuite/systemtap.examples/keyword-index.html | 3 +++ testsuite/systemtap.examples/keyword-index.txt | 7 +++++++ 4 files changed, 20 insertions(+) diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 55fea0fb..19fddaa4 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -58,6 +58,9 @@ keywords: SIMPLE
  • general/para-callgraph.stp - Callgraph tracing with arguments
    keywords: TRACE CALLGRAPH

    Print a timed per-thread callgraph, complete with function parameters and return values. The first parameter names the function probe points to trace. The optional second parameter names the probe points for trigger functions, which acts to enable tracing for only those functions that occur while the current thread is nested within the trigger.

  • +
  • interrupt/interrupts-by-dev.stp - Record interrupts on a per-device basis.
    +keywords: INTERRUPT
    +

    The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

  • interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI)
    keywords: INTERRUPT BACKTRACE

    The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.

  • diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index 16b45aac..a18cae3f 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -50,6 +50,13 @@ keywords: trace callgraph the trigger. +interrupt/interrupts-by-dev.stp - Record interrupts on a per-device basis. +keywords: interrupt + + The interrupts-by-dev.stp script profiles interrupts received by each + device per 100 ms. + + interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI) keywords: interrupt backtrace diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 1a2855e1..05de73fa 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -144,6 +144,9 @@ keywords: FILESYSTEM INTERRUPT
      +
    • interrupt/interrupts-by-dev.stp - Record interrupts on a per-device basis.
      +keywords: INTERRUPT
      +

      The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

    • interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI)
      keywords: INTERRUPT BACKTRACE

      The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.

    • diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 6de9c330..9ed52e27 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -198,6 +198,13 @@ keywords: filesystem hack = INTERRUPT = +interrupt/interrupts-by-dev.stp - Record interrupts on a per-device basis. +keywords: interrupt + + The interrupts-by-dev.stp script profiles interrupts received by each + device per 100 ms. + + interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt (IPI) keywords: interrupt backtrace -- cgit From dc5a95301448c26bc016ebc618a8038e531d85f0 Mon Sep 17 00:00:00 2001 From: Prerna Saxena Date: Mon, 16 Nov 2009 11:25:46 +0530 Subject: add definition of function irqflags_str() --- tapset/aux_syscalls.stp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 2f19ab16..d5444723 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1891,3 +1891,30 @@ function _struct_sigaction32_u:string(uaddr:long) } #endif %} + +/* + * Function irqflags_str : + * Returns the symbolic string representation of the IRQ flags. + * + */ + +%{ +#include +static const _stp_val_array const _stp_irq_list[] = { + V(IRQF_DISABLED), + V(IRQF_SAMPLE_RANDOM), + V(IRQF_SHARED), + V(IRQF_PROBE_SHARED), + V(IRQF_TIMER), + V(IRQF_PERCPU), + V(IRQF_NOBALANCING), + V(IRQF_IRQPOLL), + V(IRQF_ONESHOT), + {0, NULL} +}; +%} + +function irqflags_str:string(f:long) +%{ /* pure */ + _stp_lookup_or_str(_stp_irq_list, THIS->f, THIS->__retvalue, MAXSTRINGLEN); +%} -- cgit From 7b76473cbad92366721defee51d93396cb101134 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 10:33:20 +0100 Subject: Define IRQF_ONESHOT for older kernels. IRQF_ONESHOT was only introduced in 2.6.32. It doesn't hurt defining it if it isn't already there. It will just never show up on older kernels. * tapset/aux_syscalls.stp: Define IRQF_ONESHOT if not already defined. --- tapset/aux_syscalls.stp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index d5444723..5435d3aa 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1900,6 +1900,9 @@ function _struct_sigaction32_u:string(uaddr:long) %{ #include +#ifndef IRQF_ONESHOT +#define IRQF_ONESHOT 0x00002000 +#endif static const _stp_val_array const _stp_irq_list[] = { V(IRQF_DISABLED), V(IRQF_SAMPLE_RANDOM), -- cgit From 228af5c49c06079e6bfe1daa64ead51b1dc979c7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 10:02:50 +0100 Subject: PR10622 Search for extern $variables in symbol table. * dwflpp.h (vardie_from_symtable): New method. * dwflpp.cxx (vardie_from_symtable): New method. (literal_stmt_for_local): Use vardie_from_symtable when no location attribute and DW_AT_external. * testsuite/buildok/xtime.stp: New testcase from PR10622. --- dwflpp.cxx | 68 +++++++++++++++++++++++++++++++++++---------- dwflpp.h | 1 + testsuite/buildok/xtime.stp | 7 +++++ 3 files changed, 62 insertions(+), 14 deletions(-) create mode 100755 testsuite/buildok/xtime.stp diff --git a/dwflpp.cxx b/dwflpp.cxx index fbfe3f94..92fe04c1 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -2210,6 +2210,34 @@ dwflpp::express_as_string (string prelude, return result; } +Dwarf_Addr +dwflpp::vardie_from_symtable (Dwarf_Die *vardie, Dwarf_Addr *addr) +{ + const char *name = dwarf_diename (vardie); + if (sess.verbose > 2) + clog << "finding symtable address for " << name << "\n"; + + *addr = 0; + int syms = dwfl_module_getsymtab (module); + dwfl_assert ("Getting symbols", syms >= 0); + + for (int i = 0; *addr == 0 && i < syms; i++) + { + GElf_Sym sym; + GElf_Word shndxp; + const char *symname = dwfl_module_getsym(module, i, &sym, &shndxp); + if (symname + && ! strcmp (name, symname) + && sym.st_shndx != SHN_UNDEF + && GELF_ST_TYPE (sym.st_info) == STT_OBJECT) + *addr = sym.st_value; + } + + if (sess.verbose > 2) + clog << "found " << name << "@0x" << hex << *addr << "\n"; + + return *addr; +} string dwflpp::literal_stmt_for_local (vector& scopes, @@ -2231,30 +2259,42 @@ dwflpp::literal_stmt_for_local (vector& scopes, << ", module bias 0x" << module_bias << dec << "\n"; +#define obstack_chunk_alloc malloc +#define obstack_chunk_free free + + struct obstack pool; + obstack_init (&pool); + struct location *tail = NULL; + + /* Given $foo->bar->baz[NN], translate the location of foo. */ + + struct location *head; + Dwarf_Attribute attr_mem; if (dwarf_attr_integrate (&vardie, DW_AT_const_value, &attr_mem) == NULL && dwarf_attr_integrate (&vardie, DW_AT_location, &attr_mem) == NULL) { - throw semantic_error("failed to retrieve location " + Dwarf_Op addr_loc; + addr_loc.atom = DW_OP_addr; + // If it is an external variable try the symbol table. PR10622. + if (dwarf_attr_integrate (&vardie, DW_AT_external, &attr_mem) != NULL + && vardie_from_symtable (&vardie, &addr_loc.number) != 0) + { + head = c_translate_location (&pool, &loc2c_error, this, + &loc2c_emit_address, + 1, 0, pc, + NULL, &addr_loc, 1, &tail, NULL, NULL); + } + else + throw semantic_error("failed to retrieve location " "attribute for local '" + local + "' (dieoffset: " + lex_cast_hex(dwarf_dieoffset (&vardie)) + ")", e->tok); } - -#define obstack_chunk_alloc malloc -#define obstack_chunk_free free - - struct obstack pool; - obstack_init (&pool); - struct location *tail = NULL; - - /* Given $foo->bar->baz[NN], translate the location of foo. */ - - struct location *head = translate_location (&pool, - &attr_mem, pc, fb_attr, &tail, - e); + else + head = translate_location (&pool, &attr_mem, pc, fb_attr, &tail, e); if (dwarf_attr_integrate (&vardie, DW_AT_type, &attr_mem) == NULL) throw semantic_error("failed to retrieve type " diff --git a/dwflpp.h b/dwflpp.h index 226b84d8..b3f71eb2 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -394,6 +394,7 @@ private: // Returns the call frame address operations for the given program counter. Dwarf_Op *get_cfa_ops (Dwarf_Addr pc); + Dwarf_Addr vardie_from_symtable(Dwarf_Die *vardie, Dwarf_Addr *addr); }; #endif // DWFLPP_H diff --git a/testsuite/buildok/xtime.stp b/testsuite/buildok/xtime.stp new file mode 100755 index 00000000..e41f9b16 --- /dev/null +++ b/testsuite/buildok/xtime.stp @@ -0,0 +1,7 @@ +#! stap -p4 + +# Test for getting at an external global variable PR10622 +probe kernel.function("do_gettimeofday") +{ + printf("xtime.tv_sec:%d\n", $xtime->tv_sec); exit(); +} -- cgit From f9a0679356e44ff13347a4d810017e0a69850e03 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 11:56:38 +0100 Subject: Add documentation for ansi.stp tapset. * tapset/ansi.stp: Add documentation for every function. * doc/SystemTap_Tapset_Reference/tapsets.tmpl: Add chapter on ansi. --- doc/SystemTap_Tapset_Reference/tapsets.tmpl | 9 +++ tapset/ansi.stp | 94 ++++++++++++++++++++++++----- 2 files changed, 88 insertions(+), 15 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/tapsets.tmpl b/doc/SystemTap_Tapset_Reference/tapsets.tmpl index ff1d50da..addcf88d 100644 --- a/doc/SystemTap_Tapset_Reference/tapsets.tmpl +++ b/doc/SystemTap_Tapset_Reference/tapsets.tmpl @@ -261,4 +261,13 @@ !Itapset/conversions.stp + + Utility functions for using ansi control chars in logs + + Utility functions for logging using ansi control characters. This + lets you manipulate the cursor position and character color output + and attributes of log messages. + +!Itapset/ansi.stp + diff --git a/tapset/ansi.stp b/tapset/ansi.stp index 0152fb37..ea5376ae 100644 --- a/tapset/ansi.stp +++ b/tapset/ansi.stp @@ -9,62 +9,126 @@ # Reference: http://en.wikipedia.org/wiki/ANSI_escape_code # +/** + * sfunction ansi_clear_screen - Move cursor to top left and clear screen. + * + * Description: Sends ansi code for moving cursor to top left and then the + * ansi code for clearing the screen from the cursor position to the end. + **/ function ansi_clear_screen() { print("\033[1;1H\033[J") } -# Foreground colors | Background colors -# Black 30 | Black 40 -# Blue 34 | Red 41 -# Green 32 | Green 42 -# Cyan 36 | Yellow 43 -# Red 31 | Blue 44 -# Purple 35 | Magenta 45 -# Brown 33 | Cyan 46 -# Light Gray 37 | White 47 +/** + * sfunction ansi_set_color - Set the ansi Select Graphic Rendition mode. + * @fg: Foreground color to set. + * + * Description: Sends ansi code for Select Graphic Rendition mode for the + * given forground color. Black (30), Blue (34), Green (32), Cyan (36), + * Red (31), Purple (35), Brown (33), Light Gray (37). + */ function ansi_set_color(fg:long) { printf("\033[%dm", fg) } +/** + * sfunction ansi_set_color2 - Set the ansi Select Graphic Rendition mode. + * @fg: Foreground color to set. + * @bg: Background color to set. + * + * Description: Sends ansi code for Select Graphic Rendition mode for the + * given forground color, Black (30), Blue (34), Green (32), Cyan (36), + * Red (31), Purple (35), Brown (33), Light Gray (37) and the given + * background color, Black (40), Red (41), Green (42), Yellow (43), + * Blue (44), Magenta (45), Cyan (46), White (47). + */ function ansi_set_color2(fg:long, bg:long) { printf("\033[%d;%dm", bg, fg) } -# All attributes off 0 -# Intensity: Bold 1 -# Underline: Single 4 -# Blink: Slow 5 -# Blink: Rapid 6 -# Image: Negative 7 +/** + * sfunction ansi_set_color3 - Set the ansi Select Graphic Rendition mode. + * @fg: Foreground color to set. + * @bg: Background color to set. + * @attr: Color attribute to set. + * + * Description: Sends ansi code for Select Graphic Rendition mode for the + * given forground color, Black (30), Blue (34), Green (32), Cyan (36), + * Red (31), Purple (35), Brown (33), Light Gray (37), the given + * background color, Black (40), Red (41), Green (42), Yellow (43), + * Blue (44), Magenta (45), Cyan (46), White (47) and the color attribute + * All attributes off (0), Intensity Bold (1), Underline Single (4), + * Blink Slow (5), Blink Rapid (6), Image Negative (7). + */ function ansi_set_color3(fg:long, bg:long, attr:long) { attr_str = attr ? sprintf(";%dm", attr) : "m" printf("\033[%d;%d%s", bg, fg, attr_str) } +/** + * sfunction ansi_reset_color - Resets Select Graphic Rendition mode. + * + * Description: Sends ansi code to reset foreground, background and color + * attribute to default values. + */ function ansi_reset_color() { ansi_set_color3(0, 0, 0) } +/** + * sfunction ansi_new_line - Move cursor to new line. + * + * Description: Sends ansi code new line. + */ function ansi_new_line() { printf("\12") } +/** + * sfunction ansi_cursor_move - Move cursor to new coordinates. + * @x: Row to move the cursor to. + * @y: Colomn to move the cursor to. + * + * Description: Sends ansi code for positioning the cursor at row x + * and column y. Coordinates start at one, (1,1) is the top-left corner. + */ function ansi_cursor_move(x:long, y:long) { printf("\033[%d;%dH", y, x) } +/** + * sfunction ansi_cursor_hide - Hides the cursor. + * + * Description: Sends ansi code for hiding the cursor. + */ function ansi_cursor_hide() { print("\033[>5I") } +/** + * sfunction ansi_cursor_saves - Saves the cursor position. + * + * Description: Sends ansi code for saving the current cursor position. + */ function ansi_cursor_save() { print("\033[s") } +/** + * sfunction ansi_cursor_saves - Restores a previously saved cursor position. + * + * Description: Sends ansi code for restoring the current cursor position + * previously saved with ansi_cursor_save(). + */ function ansi_cursor_restore() { print("\033[u") } +/** + * sfunction ansi_cursor_show - Shows the cursor. + * + * Description: Sends ansi code for showing the cursor. + */ function ansi_cursor_show() { print("\033[>5h") } -- cgit From 1bc3d8e1a940e67d8e0e3f9a04cfc53d8bced85e Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 16 Nov 2009 12:58:46 -0600 Subject: PR 5150 partial fix. Support nfs_write_begin()/nfs_write_end(). * tapset/nfs.stp: Added support for nfs_write_begin()/nfs_write_end(), which replaced nfs_prepare_write()/nfs_commit_write(). --- tapset/nfs.stp | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/tapset/nfs.stp b/tapset/nfs.stp index 6b7d5eeb..7d0ebc35 100644 --- a/tapset/nfs.stp +++ b/tapset/nfs.stp @@ -816,8 +816,8 @@ probe nfs.aop.entries = nfs.aop.readpage, nfs.aop.writepage, nfs.aop.writepages, nfs.aop.release_page ?, - nfs.aop.prepare_write, - nfs.aop.commit_write + nfs.aop.__write_begin_func, + nfs.aop.__write_end_func { } @@ -826,8 +826,8 @@ probe nfs.aop.return = nfs.aop.readpage.return, nfs.aop.writepage.return, nfs.aop.writepages.return, nfs.aop.release_page.return ?, - nfs.aop.prepare_write.return, - nfs.aop.commit_write.return + nfs.aop.__write_begin_func.return, + nfs.aop.__write_end_func.return { } @@ -1064,6 +1064,78 @@ probe nfs.aop.writepages.return = kernel.function ("nfs_writepages").return !, retstr = sprintf("%d", $return) } +# kernel commit 4899f9c852564ce7b6d0ca932ac6674bf471fd28 removed +# nfs_prepare_write()/nfs_commit_write() and created +# nfs_write_begin()/nfs_write_end(). So, we try to find whatever the +# current kernel has. + +probe nfs.aop.__write_begin_func = nfs.aop.write_begin !, + nfs.aop.prepare_write +{ +} +probe nfs.aop.__write_begin_func.return + = nfs.aop.write_begin.return !, + nfs.aop.prepare_write.return +{ +} + +probe nfs.aop.__write_end_func = nfs.aop.write_end !, + nfs.aop.commit_write +{ +} +probe nfs.aop.__write_end_func.return + = nfs.aop.write_end.return !, + nfs.aop.commit_write.return +{ +} + +probe nfs.aop.write_begin = kernel.function ("nfs_write_begin") !, + module("nfs").function("nfs_write_begin") +{ + dev = __file_dev($file) + ino = __file_ino($file) + s_id = __file_id($file) + devname = kernel_string(s_id) + + pos = $pos + count = $len + + name = "nfs.aop.write_begin" + argstr = sprintf("%d", ino) + + units = "bytes" +} +probe nfs.aop.write_begin.return + = kernel.function ("nfs_write_begin").return !, + module("nfs").function ("nfs_write_begin").return +{ + name = "nfs.aop.write_begin.return" + retstr = sprintf("%d", $return) +} + +probe nfs.aop.write_end = kernel.function ("nfs_write_end") !, + module("nfs").function("nfs_write_end") +{ + dev = __file_dev($file) + ino = __file_ino($file) + s_id = __file_id($file) + devname = kernel_string(s_id) + + pos = $pos + count = $len + + name = "nfs.aop.write_end" + argstr = sprintf("%d", ino) + + units = "bytes" +} +probe nfs.aop.write_end.return = kernel.function ("nfs_write_end").return !, + module("nfs").function("nfs_write_end").return +{ + name = "nfs.aop.write_end.return" + retstr = sprintf("%d", $return) +} + /* probe nfs.aop.prepare_write * Fires when do write operation on nfs. * Prepare a page for writing -- cgit From 01a71905151a751fc81a5f58743f6915378be20a Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 20:59:16 +0100 Subject: Allow modules to trigger task_finder vma_tracker. * runtime/sym.h: Define _stp_need_vma_tracker. * translate.cxx (emit_symbol_data_done): Output _stp_need_vma_tracker value. (c_unparser::emit_module_init): If STP_NEED_VMA_TRACKER isn't defined check _stp_need_vma_tracker to call _stp_sym_init(). --- runtime/sym.h | 4 ++++ translate.cxx | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/runtime/sym.h b/runtime/sym.h index ca69345f..9f2bdfd0 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -66,6 +66,10 @@ static unsigned _stp_num_modules; /* load address, fixup by transport symbols _stp_do_relocation */ static unsigned long _stp_kretprobe_trampoline; +/* Indicates some modules requested the task finder to notify sym.c + _stp_sym_init () should track vma maps. */ +static char _stp_need_vma_tracker; + static unsigned long _stp_module_relocate (const char *module, const char *section, unsigned long offset); static struct _stp_module *_stp_get_unwind_info (unsigned long addr); diff --git a/translate.cxx b/translate.cxx index cbb8f1e3..ca298113 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1172,6 +1172,8 @@ c_unparser::emit_module_init () // PR10228: set up symbol table-related task finders. o->newline() << "#if defined(STP_NEED_VMA_TRACKER)"; o->newline() << "_stp_sym_init();"; + o->newline() << "#else"; + o->newline() << "if (_stp_need_vma_tracker == 1) _stp_sym_init();"; o->newline() << "#endif"; // NB: we don't need per-_stp_module task_finders, since a single common one // set up in runtime/sym.c's _stp_sym_init() will scan through all _stp_modules. @@ -5023,6 +5025,11 @@ emit_symbol_data_done (unwindsym_dump_context *ctx, systemtap_session& s) ctx->output << "0x" << hex << ctx->stp_kretprobe_trampoline_addr << dec << ";\n"; + // Note when someone requested the task_finder. + ctx->output << "static char _stp_need_vma_tracker = " + << (s.task_finder_derived_probes ? "1" : "0") + << ";\n"; + // Some nonexistent modules may have been identified with "-d". Note them. if (! s.suppress_warnings) for (set::iterator it = ctx->undone_unwindsym_modules.begin(); -- cgit From a295050e60affe0bb55fc2d46637314c0822f35d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 21:34:00 +0100 Subject: PR10010 Support $globals in shared libraries. * dwflpp.cxx (dwflpp::emit_address): Enable task finder and emit a _stp_module_relocate for the ".dynamic" section when seeing a user-space dso address. * runtime/sym.c (_stp_mod_sec_lookup): Remove .dynamic section addr cheat. (_stp_tf_mmap_cb): Add cheat here. --- dwflpp.cxx | 11 +++++------ runtime/sym.c | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index 92fe04c1..35637568 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -1502,12 +1502,11 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) } else { - throw semantic_error ("cannot relocate user-space dso (?) address"); -#if 0 - // This would happen for a Dwfl_Module that's a user-level DSO. - obstack_printf (pool, " /* %s+%#" PRIx64 " */", - modname, address); -#endif + enable_task_finder (sess); + obstack_printf (pool, "({ static unsigned long addr = 0; "); + obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + modname, ".dynamic", reloc_address); + obstack_printf (pool, "addr; })"); } } else diff --git a/runtime/sym.c b/runtime/sym.c index 0baa1a5e..61282183 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -45,6 +45,11 @@ static int _stp_tf_mmap_cb(struct stap_task_finder_target *tgt, path); #endif module = _stp_modules[i]; + // cheat... + if ((strcmp(".dynamic", + module->sections[0].name) == 0) + && module->sections[0].addr == 0) + module->sections[0].addr = addr; break; } } @@ -138,8 +143,6 @@ static struct _stp_module *_stp_mod_sec_lookup(unsigned long addr, *sec = &m->sections[0]; // XXX check actual section and relocate dbug_sym(1, "found section %s in module %s at 0x%lx\n", m->sections[0].name, m->name, vm_start); - if (strcmp(".dynamic", m->sections[0].name) == 0) - m->sections[0].addr = vm_start; // cheat... return m; } } -- cgit From 5409e5bf98ddc994931754d0cb1cae36ba9a08fd Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 16 Nov 2009 21:41:13 +0100 Subject: Add testcase for retrieving $global vars from execs and shared libs. Explicit testcase for PR10010 and PR10622. * testsuite/systemtap.base/externalvar.c: New file. * testsuite/systemtap.base/externalvar.exp: New file. * testsuite/systemtap.base/externalvar.stp: New file. * testsuite/systemtap.base/externalvar_lib.c: New file. --- testsuite/systemtap.base/externalvar.c | 52 ++++++++++++++++++++++ testsuite/systemtap.base/externalvar.exp | 70 ++++++++++++++++++++++++++++++ testsuite/systemtap.base/externalvar.stp | 39 +++++++++++++++++ testsuite/systemtap.base/externalvar_lib.c | 43 ++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 testsuite/systemtap.base/externalvar.c create mode 100644 testsuite/systemtap.base/externalvar.exp create mode 100644 testsuite/systemtap.base/externalvar.stp create mode 100644 testsuite/systemtap.base/externalvar_lib.c diff --git a/testsuite/systemtap.base/externalvar.c b/testsuite/systemtap.base/externalvar.c new file mode 100644 index 00000000..a7716029 --- /dev/null +++ b/testsuite/systemtap.base/externalvar.c @@ -0,0 +1,52 @@ +/* externalvar test case + * Copyright (C) 2009, Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + * + * Tests that an external exported variable can be accessed. + */ + +#include + +// function from our library +int lib_main (void); + +struct exestruct +{ + char c; + int i; + long l; + struct exestruct *s1; + struct exestruct *s2; +}; + +char exevar_c; +int exevar_i; +long exevar_l; +struct exestruct *exe_s; + +static void +main_call () +{ + asm (""); // dummy method, just to probe and extract and jump into lib. + lib_main (); +} + +int +main () +{ + exevar_c = 42; + exevar_i = 2; + exevar_l = 21; + exe_s = (struct exestruct *) malloc(sizeof(struct exestruct)); + exe_s->i =1; + exe_s->l =2; + exe_s->c =3; + exe_s->s1 = NULL; + exe_s->s2 = exe_s; + main_call (); + return 0; +} diff --git a/testsuite/systemtap.base/externalvar.exp b/testsuite/systemtap.base/externalvar.exp new file mode 100644 index 00000000..668dec55 --- /dev/null +++ b/testsuite/systemtap.base/externalvar.exp @@ -0,0 +1,70 @@ +set test "externalvar" +set testpath "$srcdir/$subdir" +set testsrc "$testpath/$test.c" +set testsrclib "$testpath/${test}_lib.c" +set testexe "[pwd]/$test" +set testlibname "$test" +set testlibdir "[pwd]" +set testso "$testlibdir/lib${testlibname}.so" +set testflags "additional_flags=-g additional_flags=-O0" +set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared" +set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir" + +# Only run on make installcheck and utrace present. +if {! [installtest_p]} { untested "$test"; return } +if {! [utrace_p]} { untested "$test"; return } + +# Compile our test program and library. +set res [target_compile $testsrclib $testso executable $testlibflags] +if { $res != "" } { + verbose "target_compile for $testso failed: $res" 2 + fail "unable to compile $testsrclib" + return +} +set res [target_compile $testsrc $testexe executable $maintestflags] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "unable to compile $testsrc" + return +} + +set output {exevar_c = 42 +exevar_i = 2 +exevar_l = 21 +exe_s->i = 1 +exe_s->l = 2 +exe_s->c = 3 +exe_s->s1 = 0x0 +exe_s == exe_s->s2 +libvar = 42 +lib_s->i = 1 +lib_s->l = 2 +lib_s->c = 3 +lib_s == lib_s->s1 +lib_s->s2 = 0x0} + +# Got to run stap with both the exe and the libraries used as -d args. +set cmd [concat stap -d $testso -d $testexe -c $testexe $testpath/$test.stp] +send_log "cmd: $cmd\n" +catch {eval exec $cmd} res +send_log "cmd output: $res\n" + +set n 0 +set m [llength [split $output "\n"]] +set expected [split $output "\n"] +foreach line [split $res "\n"] { + if {![string equal $line [lindex $expected $n]]} { + fail $test + send_log "line [expr $n + 1]: expected \"[lindex $expected $n]\", " + send_log "Got \"$line\"\n" + return + } + incr n +} +if { $n != $m } { + fail $test + send_log "Got \"$n\" lines, expected \"$m\" lines\n" +} else { + pass $test +} +# exec rm -f $testexe $testso diff --git a/testsuite/systemtap.base/externalvar.stp b/testsuite/systemtap.base/externalvar.stp new file mode 100644 index 00000000..7d4b69bb --- /dev/null +++ b/testsuite/systemtap.base/externalvar.stp @@ -0,0 +1,39 @@ +probe process("externalvar").function("main_call") +{ + printf("exevar_c = %d\n", $exevar_c); + printf("exevar_i = %d\n", $exevar_i); + printf("exevar_l = %d\n", $exevar_l); + + printf("exe_s->i = %d\n", $exe_s->i); + printf("exe_s->l = %d\n", $exe_s->l); + printf("exe_s->c = %d\n", $exe_s->c); + + printf("exe_s->s1 = 0x%x\n", $exe_s->s1); + if ($exe_s == $exe_s->s2) + { + printf("exe_s == exe_s->s2\n"); + } + else + { + printf("exe_s != exe_s->s2\n"); + } +} + +probe process("libexternalvar.so").function("lib_call") +{ + printf("libvar = %d\n", $libvar); + + printf("lib_s->i = %d\n", $lib_s->i); + printf("lib_s->l = %d\n", $lib_s->l); + printf("lib_s->c = %d\n", $lib_s->c); + + if ($lib_s == $lib_s->s1) + { + printf("lib_s == lib_s->s1\n"); + } + else + { + printf("lib_s != lib_s->s2\n"); + } + printf("lib_s->s2 = 0x%x\n", $lib_s->s2); +} diff --git a/testsuite/systemtap.base/externalvar_lib.c b/testsuite/systemtap.base/externalvar_lib.c new file mode 100644 index 00000000..9017e798 --- /dev/null +++ b/testsuite/systemtap.base/externalvar_lib.c @@ -0,0 +1,43 @@ +/* external var test case - library helper + * Copyright (C) 2009, Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + * + * Tests that an external exported variable can be accessed. + */ + +#include + +struct libstruct +{ + int i; + long l; + char c; + struct libstruct *s1; + struct libstruct *s2; +}; + +int libvar; +struct libstruct *lib_s; + +static void +lib_call () +{ + asm(""); // dummy method, just to probe and extract. +} + +void +lib_main () +{ + libvar = 42; + lib_s = (struct libstruct *) malloc(sizeof(struct libstruct)); + lib_s->i = 1; + lib_s->l = 2; + lib_s->c = 3; + lib_s->s1 = lib_s; + lib_s->s2 = NULL; + lib_call (); +} -- cgit From e7c84665f79fd944371c2c49e57189ed1f6cee6d Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 16 Nov 2009 15:53:33 -0600 Subject: PR 5150 partial fixes. Added support for nfs_file_fsync. * tapset/nfs.stp(nfs.fop.fsync): Added support for nfs_file_fsync. (nfs.fop.fsync.return): Ditto. (nfs.aop.readpages.return): Fixed 'size' bug. (nfs.aop.write_begin): Renamed to make 'nfs.*.*' probes work correctly. (nfs.aop.write_end): Ditto. (__nfs.aop.write_begin): Ditto. (__nfs.aop.write_end): Ditto. (__nfs.aop.prepare_write): Ditto. (__nfs.aop.commit_write): Ditto. (nfs.fop.aio_read.return): Always sets 'units'. (nfs.fop.aio_write.return): Ditto. (nfs.fop.sendfile.return): Ditto. --- tapset/nfs.stp | 77 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/tapset/nfs.stp b/tapset/nfs.stp index 7d0ebc35..50bdc087 100644 --- a/tapset/nfs.stp +++ b/tapset/nfs.stp @@ -450,8 +450,8 @@ probe nfs.fop.aio_read.return = kernel.function ("nfs_file_read").return !, if ($return > 0) { size = $return - units = "bytes" } + units = "bytes" } /* probe nfs.fop.aio_write @@ -503,8 +503,8 @@ probe nfs.fop.aio_write.return = kernel.function("nfs_file_write").return !, if ($return > 0) { size = $return - units = "bytes" } + units = "bytes" } /* probe nfs.fop.mmap @@ -669,7 +669,9 @@ probe nfs.fop.release.return = kernel.function("nfs_file_release").return !, * ino : inode number * ndirty : number of dirty pages */ -probe nfs.fop.fsync = kernel.function("nfs_fsync") !, +probe nfs.fop.fsync = kernel.function("nfs_file_fsync") !, + module("nfs").function("nfs_file_fsync") !, + kernel.function("nfs_fsync") !, module("nfs").function("nfs_fsync") { dev = __file_dev($file) @@ -683,7 +685,9 @@ probe nfs.fop.fsync = kernel.function("nfs_fsync") !, argstr = sprintf("%d", ino) } -probe nfs.fop.fsync.return = kernel.function("nfs_fsync").return !, +probe nfs.fop.fsync.return = kernel.function("nfs_file_fsync").return !, + module("nfs").function("nfs_file_fsync").return !, + kernel.function("nfs_fsync").return !, module("nfs").function("nfs_fsync").return { name = "nfs.fop.fsync.return" @@ -782,8 +786,8 @@ probe nfs.fop.sendfile.return = kernel.function("nfs_file_sendfile").return !, if ($return > 0) { size = $return - units = "bytes" } + units = "bytes" } %) @@ -816,8 +820,8 @@ probe nfs.aop.entries = nfs.aop.readpage, nfs.aop.writepage, nfs.aop.writepages, nfs.aop.release_page ?, - nfs.aop.__write_begin_func, - nfs.aop.__write_end_func + nfs.aop.write_begin, + nfs.aop.write_end { } @@ -826,8 +830,8 @@ probe nfs.aop.return = nfs.aop.readpage.return, nfs.aop.writepage.return, nfs.aop.writepages.return, nfs.aop.release_page.return ?, - nfs.aop.__write_begin_func.return, - nfs.aop.__write_end_func.return + nfs.aop.write_begin.return, + nfs.aop.write_end.return { } @@ -922,9 +926,8 @@ probe nfs.aop.readpages.return = kernel.function ("nfs_readpages").return !, name = "nfs.aop.readpages.return" retstr = sprintf("%d", $return) - if ($return > 0 ) - { - size = retstr + if ($return > 0 ) { + size = $return } units = "pages" } @@ -1069,28 +1072,28 @@ probe nfs.aop.writepages.return = kernel.function ("nfs_writepages").return !, # nfs_write_begin()/nfs_write_end(). So, we try to find whatever the # current kernel has. -probe nfs.aop.__write_begin_func = nfs.aop.write_begin !, - nfs.aop.prepare_write +probe nfs.aop.write_begin = __nfs.aop.write_begin !, + __nfs.aop.prepare_write { } -probe nfs.aop.__write_begin_func.return - = nfs.aop.write_begin.return !, - nfs.aop.prepare_write.return +probe nfs.aop.write_begin.return + = __nfs.aop.write_begin.return !, + __nfs.aop.prepare_write.return { } -probe nfs.aop.__write_end_func = nfs.aop.write_end !, - nfs.aop.commit_write +probe nfs.aop.write_end = __nfs.aop.write_end !, + __nfs.aop.commit_write { } -probe nfs.aop.__write_end_func.return - = nfs.aop.write_end.return !, - nfs.aop.commit_write.return +probe nfs.aop.write_end.return + = __nfs.aop.write_end.return !, + __nfs.aop.commit_write.return { } -probe nfs.aop.write_begin = kernel.function ("nfs_write_begin") !, - module("nfs").function("nfs_write_begin") +probe __nfs.aop.write_begin = kernel.function ("nfs_write_begin") !, + module("nfs").function("nfs_write_begin") { dev = __file_dev($file) ino = __file_ino($file) @@ -1105,7 +1108,7 @@ probe nfs.aop.write_begin = kernel.function ("nfs_write_begin") !, units = "bytes" } -probe nfs.aop.write_begin.return +probe __nfs.aop.write_begin.return = kernel.function ("nfs_write_begin").return !, module("nfs").function ("nfs_write_begin").return { @@ -1113,8 +1116,8 @@ probe nfs.aop.write_begin.return retstr = sprintf("%d", $return) } -probe nfs.aop.write_end = kernel.function ("nfs_write_end") !, - module("nfs").function("nfs_write_end") +probe __nfs.aop.write_end = kernel.function ("nfs_write_end") !, + module("nfs").function("nfs_write_end") { dev = __file_dev($file) ino = __file_ino($file) @@ -1129,8 +1132,9 @@ probe nfs.aop.write_end = kernel.function ("nfs_write_end") !, units = "bytes" } -probe nfs.aop.write_end.return = kernel.function ("nfs_write_end").return !, - module("nfs").function("nfs_write_end").return +probe __nfs.aop.write_end.return + = kernel.function ("nfs_write_end").return !, + module("nfs").function("nfs_write_end").return { name = "nfs.aop.write_end.return" retstr = sprintf("%d", $return) @@ -1156,8 +1160,8 @@ probe nfs.aop.write_end.return = kernel.function ("nfs_write_end").return !, * in the page frame * size : write bytes */ -probe nfs.aop.prepare_write = kernel.function ("nfs_prepare_write") !, - module("nfs").function ("nfs_prepare_write") +probe __nfs.aop.prepare_write = kernel.function ("nfs_prepare_write") !, + module("nfs").function ("nfs_prepare_write") { __page = $page dev = __page_dev(__page) @@ -1176,7 +1180,7 @@ probe nfs.aop.prepare_write = kernel.function ("nfs_prepare_write") !, units = "bytes" } -probe nfs.aop.prepare_write.return = +probe __nfs.aop.prepare_write.return = kernel.function ("nfs_prepare_write").return !, module("nfs").function ("nfs_prepare_write").return { @@ -1204,16 +1208,15 @@ probe nfs.aop.prepare_write.return = * in the page frame * size : write bytes */ -probe nfs.aop.commit_write = kernel.function ("nfs_commit_write") !, - module("nfs").function ("nfs_commit_write") +probe __nfs.aop.commit_write = kernel.function ("nfs_commit_write") !, + module("nfs").function ("nfs_commit_write") { - __page = $page + __page = $page dev = __page_dev(__page) ino = __page_ino(__page) offset = $offset to = $to - i_flag = __p2i_flag($page) i_size = __p2i_size($page) @@ -1229,7 +1232,7 @@ probe nfs.aop.commit_write = kernel.function ("nfs_commit_write") !, units = "bytes" } -probe nfs.aop.commit_write.return = +probe __nfs.aop.commit_write.return = kernel.function ("nfs_commit_write").return !, module("nfs").function ("nfs_commit_write").return { -- cgit From 110a589704c72327ba80aaf75bff496a6b6334f6 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 09:24:41 +0100 Subject: Explain "cheat" comment in sym.c (_stp_tf_mmap_cb). We are abusing the "first" section address here to indicate where the module (actually first segment) is loaded (which is why we are ignoring the offset). It would be good to redesign the stp_module/stp_section data structures to better align with the actual memory mappings we are interested in (especially the "section" naming is slightly confusing since what we really seem to mean are elf segments (which can contain multiple elf sections). * runtime/sym.c (_stp_tf_mmap_cb): Add cheat comment. --- runtime/sym.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtime/sym.c b/runtime/sym.c index 61282183..fd9863dd 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -46,6 +46,17 @@ static int _stp_tf_mmap_cb(struct stap_task_finder_target *tgt, #endif module = _stp_modules[i]; // cheat... + // We are abusing the "first" section address + // here to indicate where the module (actually + // first segment) is loaded (which is why we + // are ignoring the offset). It would be good + // to redesign the stp_module/stp_section + // data structures to better align with the + // actual memory mappings we are interested + // in (especially the "section" naming is + // slightly confusing since what we really + // seem to mean are elf segments (which can + // contain multiple elf sections). if ((strcmp(".dynamic", module->sections[0].name) == 0) && module->sections[0].addr == 0) -- cgit From f685b2fea262d1e517d75d69c84ec0d1edea6cf0 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 10:10:31 +0100 Subject: Remove caching of emit_address for kernel modules and shared libraries. Caching of the address is only safe for kernel addresses that can never change. For kernel module or dynamic shared library addresses it isn't safe to cache the address since they can be unloaded, reloaded or mapped differently in separate executables. * dwflpp.cxx (emit_address): Remove static from addr definition for kernel and dynamic modules. --- dwflpp.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index 35637568..53f3d8eb 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -1484,8 +1484,8 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) { // This gives us the module name, and section name within the // module, for a kernel module (or other ET_REL module object). - obstack_printf (pool, "({ static unsigned long addr = 0; "); - obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + obstack_printf (pool, "({ unsigned long addr = 0; "); + obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", modname, secname, reloc_address); obstack_printf (pool, "addr; })"); } @@ -1495,6 +1495,9 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) // need to treat the same way here as dwarf_query::add_probe_point does: _stext. address -= sess.sym_stext; secname = "_stext"; + // Note we "cache" the result here through a static because the + // kernel will never move after being loaded (unlike modules and + // user-space dynamic share libraries). obstack_printf (pool, "({ static unsigned long addr = 0; "); obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", modname, secname, address); // PR10000 NB: not reloc_address @@ -1503,8 +1506,8 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address) else { enable_task_finder (sess); - obstack_printf (pool, "({ static unsigned long addr = 0; "); - obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + obstack_printf (pool, "({ unsigned long addr = 0; "); + obstack_printf (pool, "addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", modname, ".dynamic", reloc_address); obstack_printf (pool, "addr; })"); } -- cgit From b0490786a904cbd19fb04c3d66ac3c277bfc2c71 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 16:11:28 +0100 Subject: Use DW_AT_MIPS_linkage_name when available in vardie_from_symtable. If there is a DW_AT_MIPS_linkage_name it encodes the actual name of the variable as used in the symbol table. * dwflpp.cpp (vardie_from_symtable): Check whether there is a DW_AT_MIPS_linkage_name attribute and use its value if so. --- dwflpp.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index 53f3d8eb..fdbcddf4 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -2215,7 +2215,14 @@ dwflpp::express_as_string (string prelude, Dwarf_Addr dwflpp::vardie_from_symtable (Dwarf_Die *vardie, Dwarf_Addr *addr) { - const char *name = dwarf_diename (vardie); + const char *name; + Dwarf_Attribute attr_mem; + name = dwarf_formstring (dwarf_attr_integrate (vardie, + DW_AT_MIPS_linkage_name, + &attr_mem)); + if (!name) + name = dwarf_diename (vardie); + if (sess.verbose > 2) clog << "finding symtable address for " << name << "\n"; -- cgit From 9fdaa114d043b284dd51d545ee2bfaec6d33857b Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 17 Nov 2009 12:52:35 -0600 Subject: PR 10974 fix. Fixed aux_syscalls.stp for RHEL5. * tapset/aux_syscalls.stp: Only define entries for IRQF_NOBALANCING/IRQF_IRQPOLL if they exist. --- tapset/aux_syscalls.stp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 5435d3aa..7dac038d 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1910,8 +1910,12 @@ static const _stp_val_array const _stp_irq_list[] = { V(IRQF_PROBE_SHARED), V(IRQF_TIMER), V(IRQF_PERCPU), +#ifdef IRQF_NOBALANCING V(IRQF_NOBALANCING), +#endif +#ifdef IRQF_IRQPOLL V(IRQF_IRQPOLL), +#endif V(IRQF_ONESHOT), {0, NULL} }; -- cgit From 0e357e42f614362b37c0b55a840eb585b04b311c Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 17 Nov 2009 13:50:03 -0600 Subject: Fixed aux_syscalls.stp for RHEL4. * tapset/aux_syscalls.stp: Only define entries for IRQF_* flags if they exist. --- tapset/aux_syscalls.stp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 7dac038d..6e45e8e1 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1904,12 +1904,24 @@ function _struct_sigaction32_u:string(uaddr:long) #define IRQF_ONESHOT 0x00002000 #endif static const _stp_val_array const _stp_irq_list[] = { +#ifdef IRQF_DISABLED V(IRQF_DISABLED), +#endif +#ifdef IRQF_SAMPLE_RANDOM V(IRQF_SAMPLE_RANDOM), +#endif +#ifdef IRQF_SHARED V(IRQF_SHARED), +#endif +#ifdef IRQF_PROBE_SHARED V(IRQF_PROBE_SHARED), +#endif +#ifdef IRQF_TIMER V(IRQF_TIMER), +#endif +#ifdef IRQF_PERCPU V(IRQF_PERCPU), +#endif #ifdef IRQF_NOBALANCING V(IRQF_NOBALANCING), #endif -- cgit From 063906a93ee3ea5b976f43e2dd1f73d29605fa4c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 22:20:32 +0100 Subject: Search other CUs of the module when resolving declarations. * dwflpp.h (declaration_resolve_other_cus): New method. (iterate_over_globals): Mark as static and takes a CU to iterate over. (global_alias_caching_callback_cus): New method. * dwflpp.cxx (global_alias_caching_callback_cus): New method. (declaration_resolve_other_cus): New method. (declaration_resolve): Call iterate_over_globals() with current cu. Call declaration_resolve_other_cus() when name not found. (iterate_over_globals): Takes cu_die to iterate over as argument. --- dwflpp.cxx | 48 ++++++++++++++++++++++++++++++++++++++---------- dwflpp.h | 7 +++++-- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index fdbcddf4..0e8a352d 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -721,6 +721,37 @@ dwflpp::global_alias_caching_callback(Dwarf_Die *die, void *arg) return DWARF_CB_OK; } +int +dwflpp::global_alias_caching_callback_cus(Dwarf_Die *die, void *arg) +{ + mod_cu_type_cache_t *global_alias_cache; + global_alias_cache = &static_cast(arg)->global_alias_cache; + + cu_type_cache_t *v = (*global_alias_cache)[die->addr]; + if (v != 0) + return DWARF_CB_OK; + + v = new cu_type_cache_t; + (*global_alias_cache)[die->addr] = v; + iterate_over_globals(die, global_alias_caching_callback, v); + + return DWARF_CB_OK; +} + +Dwarf_Die * +dwflpp::declaration_resolve_other_cus(const char *name) +{ + iterate_over_cus(global_alias_caching_callback_cus, this); + for (mod_cu_type_cache_t::iterator i = global_alias_cache.begin(); + i != global_alias_cache.end(); ++i) + { + cu_type_cache_t *v = (*i).second; + if (v->find(name) != v->end()) + return & ((*v)[name]); + } + + return NULL; +} Dwarf_Die * dwflpp::declaration_resolve(const char *name) @@ -733,7 +764,7 @@ dwflpp::declaration_resolve(const char *name) { v = new cu_type_cache_t; global_alias_cache[cu->addr] = v; - iterate_over_globals(global_alias_caching_callback, v); + iterate_over_globals(cu, global_alias_caching_callback, v); if (sess.verbose > 4) clog << "global alias cache " << module_name << ":" << cu_name() << " size " << v->size() << endl; @@ -744,11 +775,8 @@ dwflpp::declaration_resolve(const char *name) // forward-declared pointer type only, where the actual definition // may only be in vmlinux or the application. - // XXX: it is probably desirable to search other CU's declarations - // in the same module. - if (v->find(name) == v->end()) - return NULL; + return declaration_resolve_other_cus(name); return & ((*v)[name]); } @@ -839,17 +867,17 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * /* This basically only goes one level down from the compile unit so it * only picks up top level stuff (i.e. nothing in a lower scope) */ int -dwflpp::iterate_over_globals (int (* callback)(Dwarf_Die *, void *), +dwflpp::iterate_over_globals (Dwarf_Die *cu_die, + int (* callback)(Dwarf_Die *, void *), void * data) { int rc = DWARF_CB_OK; Dwarf_Die die; - assert (module); - assert (cu); - assert (dwarf_tag(cu) == DW_TAG_compile_unit); + assert (cu_die); + assert (dwarf_tag(cu_die) == DW_TAG_compile_unit); - if (dwarf_child(cu, &die) != 0) + if (dwarf_child(cu_die, &die) != 0) return rc; do diff --git a/dwflpp.h b/dwflpp.h index b3f71eb2..cdc6ad98 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -213,6 +213,7 @@ struct dwflpp std::vector getscopes(Dwarf_Addr pc); Dwarf_Die *declaration_resolve(const char *name); + Dwarf_Die *declaration_resolve_other_cus(const char *name); mod_cu_function_cache_t cu_function_cache; @@ -319,8 +320,10 @@ private: */ mod_cu_type_cache_t global_alias_cache; static int global_alias_caching_callback(Dwarf_Die *die, void *arg); - int iterate_over_globals (int (* callback)(Dwarf_Die *, void *), - void * data); + static int global_alias_caching_callback_cus(Dwarf_Die *die, void *arg); + static int iterate_over_globals (Dwarf_Die *, + int (* callback)(Dwarf_Die *, void *), + void * data); static int cu_function_caching_callback (Dwarf_Die* func, void *arg); -- cgit From 59d75133957c0478f14c6c6215fbb86d39739b82 Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 17 Nov 2009 15:40:59 -0600 Subject: With tapset/aux_syscalls.stp fixes, test twentyseven.stp is not kfail. * testsuite/systemtap.pass1-4/buildok.exp: Test twentyseven.stp should pass now. --- testsuite/systemtap.pass1-4/buildok.exp | 1 - 1 file changed, 1 deletion(-) diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp index 12275c1d..8ab8b139 100644 --- a/testsuite/systemtap.pass1-4/buildok.exp +++ b/testsuite/systemtap.pass1-4/buildok.exp @@ -6,7 +6,6 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { # some tests are known to fail. switch $test { buildok/perfmon01.stp {setup_kfail 909 *-*-*} - buildok/twentyseven.stp {setup_kfail 4166 *-*-*} buildok/sched_test.stp {setup_kfail 1155 *-*-*} buildok/process_test.stp {setup_kfail 1155 *-*-*} buildok/rpc-all-probes.stp {setup_kfail 4413 *-*-*} -- cgit From 4d598c650a430fa16af5cfd9202d63931823b547 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Nov 2009 23:41:31 +0100 Subject: Document is_return(), module_name() and stp_pid() context tapset functions. --- tapset/context.stp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/tapset/context.stp b/tapset/context.stp index 14128589..36701e6e 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -210,7 +210,12 @@ function user_mode:long () %{ /* pure */ /* unprivileged */ } %} - +/** + * sfunction is_return - Whether the current probe context is a return probe. + * + * Description: Returns 1 if the current probe context is a return probe, + * returns 0 otherwise. + */ function is_return:long () %{ /* pure */ if (CONTEXT->pi) THIS->__retvalue = 1; @@ -225,24 +230,22 @@ function target:long () %{ /* pure */ /* unprivileged */ THIS->__retvalue = _stp_target; %} -/// -/// module_name:string() -/// module_name -/// -/// FIXME: need description. -/// -/// +/** + * sfunction module_name - The module name of the current script. + * + * Returns the name of the stap module. Either generated randomly + * (stap_[0-9a-f]+_[0-9a-f]+) or set by stap -m . + */ function module_name:string () %{ /* pure */ /* unprivileged */ strlcpy(THIS->__retvalue, THIS_MODULE->name, MAXSTRINGLEN); %} -/// -/// stp_pid:long() -/// stp_pid -/// -/// FIXME: need description. -/// -/// +/** + * sfunction stp_pid - The process id of the stapio process. + * + * Returns the process id of the stapio process that launched + * this script. + */ function stp_pid:long () %{ /* pure */ THIS->__retvalue = _stp_pid; %} -- cgit From 47f390f910576d8165f788035473bf8d5ffcf7f0 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 17 Nov 2009 20:11:12 -0500 Subject: PR4037: 32-bit staprun vs. 64-bit kernels just works (tm) * configure.ac (PROCFLAGS): Don't define it. * Makefile.am: Don't use it. --- Makefile.am | 8 ++++---- Makefile.in | 12 +++++------- configure | 17 +++-------------- configure.ac | 16 +++------------- doc/Makefile.in | 1 - doc/SystemTap_Tapset_Reference/Makefile.in | 1 - grapher/Makefile.in | 1 - 7 files changed, 15 insertions(+), 41 deletions(-) diff --git a/Makefile.am b/Makefile.am index f53e4d07..469601c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -151,9 +151,9 @@ staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\ runtime/staprun/ctl.c runtime/staprun/common.c staprun_CPPFLAGS = $(AM_CPPFLAGS) -staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) @PIECFLAGS@ -DSINGLE_THREADED -fno-strict-aliasing -fno-builtin-strftime +staprun_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -DSINGLE_THREADED -fno-strict-aliasing -fno-builtin-strftime staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ -staprun_LDADD = @PROCFLAGS@ +staprun_LDADD = if HAVE_NSS staprun_SOURCES += runtime/staprun/modverify.c nsscommon.c @@ -165,9 +165,9 @@ stapio_SOURCES = runtime/staprun/stapio.c \ runtime/staprun/mainloop.c runtime/staprun/common.c \ runtime/staprun/ctl.c \ runtime/staprun/relay.c runtime/staprun/relay_old.c -stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) @PIECFLAGS@ -fno-strict-aliasing -fno-builtin-strftime +stapio_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -fno-strict-aliasing -fno-builtin-strftime stapio_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ -stapio_LDADD = @PROCFLAGS@ -lpthread +stapio_LDADD = -lpthread install-exec-hook: diff --git a/Makefile.in b/Makefile.in index af68b3b4..98b0ea34 100644 --- a/Makefile.in +++ b/Makefile.in @@ -319,7 +319,6 @@ PIECFLAGS = @PIECFLAGS@ PIECXXFLAGS = @PIECXXFLAGS@ PIELDFLAGS = @PIELDFLAGS@ PKG_CONFIG = @PKG_CONFIG@ -PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ RPM_CFLAGS = @RPM_CFLAGS@ RPM_LIBS = @RPM_LIBS@ @@ -442,19 +441,18 @@ staprun_SOURCES = runtime/staprun/staprun.c \ runtime/staprun/staprun_funcs.c runtime/staprun/ctl.c \ runtime/staprun/common.c $(am__append_16) staprun_CPPFLAGS = $(AM_CPPFLAGS) -staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) @PIECFLAGS@ \ - -DSINGLE_THREADED -fno-strict-aliasing -fno-builtin-strftime \ - $(am__append_17) +staprun_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -DSINGLE_THREADED \ + -fno-strict-aliasing -fno-builtin-strftime $(am__append_17) staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ -staprun_LDADD = @PROCFLAGS@ $(am__append_18) +staprun_LDADD = $(am__append_18) stapio_SOURCES = runtime/staprun/stapio.c \ runtime/staprun/mainloop.c runtime/staprun/common.c \ runtime/staprun/ctl.c \ runtime/staprun/relay.c runtime/staprun/relay_old.c -stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) @PIECFLAGS@ -fno-strict-aliasing -fno-builtin-strftime +stapio_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -fno-strict-aliasing -fno-builtin-strftime stapio_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ -stapio_LDADD = @PROCFLAGS@ -lpthread +stapio_LDADD = -lpthread @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_sign_module_SOURCES = modsign.cxx nsscommon.c @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_sign_module_CPPFLAGS = -Wall -Werror $(AM_CPPFLAGS) $(nss_CFLAGS) $(nspr_CFLAGS) @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_sign_module_LDADD = -lnss3 -lnspr4 diff --git a/configure b/configure index b98c4f9c..c7d87a34 100755 --- a/configure +++ b/configure @@ -642,7 +642,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS subdirs -PROCFLAGS DATE stap_LIBS elfutils_abs_srcdir @@ -8743,19 +8742,9 @@ _ACEOF DATE="$date" - -# This procflags business is for staprun/stapio, which need to -# be compiled with the same bitness as the kernel. On e.g. PPC, -# userspace might be 32-bit default, but staprun needs to be -# 64-bit. See also bug #4037. - -processor=`uname -p` -case "$processor" in -ppc64) PROCFLAGS=-m64 ;; -x86_64) PROCFLAGS=-m64 ;; -*) PROCFLAGS="" -esac - +# Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun +# being compiled on 32-bit userspace but running against 64-bit kernels. +# This is no longer necessary. # Use tr1/unordered_map if available ac_ext=cpp diff --git a/configure.ac b/configure.ac index e92adf5f..cf9379c2 100644 --- a/configure.ac +++ b/configure.ac @@ -578,19 +578,9 @@ date=`date +%Y-%m-%d` AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date]) AC_SUBST(DATE, "$date") - -# This procflags business is for staprun/stapio, which need to -# be compiled with the same bitness as the kernel. On e.g. PPC, -# userspace might be 32-bit default, but staprun needs to be -# 64-bit. See also bug #4037. - -processor=`uname -p` -case "$processor" in -ppc64) PROCFLAGS=-m64 ;; -x86_64) PROCFLAGS=-m64 ;; -*) PROCFLAGS="" -esac -AC_SUBST([PROCFLAGS]) +# Before PR4037, we used to arrange to pass CFLAGS+=-m64 for a staprun +# being compiled on 32-bit userspace but running against 64-bit kernels. +# This is no longer necessary. # Use tr1/unordered_map if available AC_LANG_PUSH(C++) diff --git a/doc/Makefile.in b/doc/Makefile.in index 793abea2..71004965 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -143,7 +143,6 @@ PIECFLAGS = @PIECFLAGS@ PIECXXFLAGS = @PIECXXFLAGS@ PIELDFLAGS = @PIELDFLAGS@ PKG_CONFIG = @PKG_CONFIG@ -PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ RPM_CFLAGS = @RPM_CFLAGS@ RPM_LIBS = @RPM_LIBS@ diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index 877dfae4..5059b159 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -125,7 +125,6 @@ PIECFLAGS = @PIECFLAGS@ PIECXXFLAGS = @PIECXXFLAGS@ PIELDFLAGS = @PIELDFLAGS@ PKG_CONFIG = @PKG_CONFIG@ -PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ RPM_CFLAGS = @RPM_CFLAGS@ RPM_LIBS = @RPM_LIBS@ diff --git a/grapher/Makefile.in b/grapher/Makefile.in index 0c40336d..34b0cd7a 100644 --- a/grapher/Makefile.in +++ b/grapher/Makefile.in @@ -167,7 +167,6 @@ PIECFLAGS = @PIECFLAGS@ PIECXXFLAGS = @PIECXXFLAGS@ PIELDFLAGS = @PIELDFLAGS@ PKG_CONFIG = @PKG_CONFIG@ -PROCFLAGS = @PROCFLAGS@ RANLIB = @RANLIB@ RPM_CFLAGS = @RPM_CFLAGS@ RPM_LIBS = @RPM_LIBS@ -- cgit From 1b0350b522d4fe24ed1922602a60eab6f96c305d Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Wed, 18 Nov 2009 10:47:33 +0800 Subject: Make interrupts-by-dev.stp executable --- testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp old mode 100644 new mode 100755 -- cgit From 2e66901da2ffed2261784f458a2fc57d6f059725 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 17 Nov 2009 18:59:47 -0800 Subject: Test cross-CU type discovery Check that we can dereference a type declaration that is defined in a separate CU from the function. --- testsuite/systemtap.base/cu-decl-1.c | 17 +++++++++++++++++ testsuite/systemtap.base/cu-decl-2.c | 10 ++++++++++ testsuite/systemtap.base/cu-decl.exp | 23 +++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 testsuite/systemtap.base/cu-decl-1.c create mode 100644 testsuite/systemtap.base/cu-decl-2.c create mode 100644 testsuite/systemtap.base/cu-decl.exp diff --git a/testsuite/systemtap.base/cu-decl-1.c b/testsuite/systemtap.base/cu-decl-1.c new file mode 100644 index 00000000..9743d298 --- /dev/null +++ b/testsuite/systemtap.base/cu-decl-1.c @@ -0,0 +1,17 @@ +#include + +struct foo; +struct foo* get_foo(void); + +void +print(struct foo* f) +{ + printf("%p\n", f); +} + +int +main() +{ + print(get_foo()); + return 0; +} diff --git a/testsuite/systemtap.base/cu-decl-2.c b/testsuite/systemtap.base/cu-decl-2.c new file mode 100644 index 00000000..46503251 --- /dev/null +++ b/testsuite/systemtap.base/cu-decl-2.c @@ -0,0 +1,10 @@ +struct foo { + int x, y; +}; + +struct foo* +get_foo() +{ + static struct foo f = { 6, 7 }; + return &f; +} diff --git a/testsuite/systemtap.base/cu-decl.exp b/testsuite/systemtap.base/cu-decl.exp new file mode 100644 index 00000000..42e683cb --- /dev/null +++ b/testsuite/systemtap.base/cu-decl.exp @@ -0,0 +1,23 @@ +# Check that we can dereference a type declaration that is +# defined in a separate CU from the function. +set test "cu-decl" + +set script { + probe process("cu-decl").function("print") { + println($f->x * $f->y) + } +} + +set sources "$srcdir/$subdir/$test-1.c $srcdir/$subdir/$test-2.c" +set res [target_compile $sources $test executable "additional_flags=-g"] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "$test target compilation" + untested "$test" +} else { + pass "$test target compilation" +} + +stap_compile $test 1 "{$script}" + +catch {exec rm $test} -- cgit From 66f73b62a4ed147b229237407a00688e61f96d5a Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Wed, 18 Nov 2009 17:59:24 +0800 Subject: Clean up examples --- testsuite/systemtap.examples/general/badname.stp | 2 +- testsuite/systemtap.examples/general/grapher.stp | 2 +- testsuite/systemtap.examples/general/graphs.stp | 2 +- testsuite/systemtap.examples/io/ioblktime.meta | 2 +- testsuite/systemtap.examples/io/iotime.meta | 2 +- testsuite/systemtap.examples/io/iotime.stp | 2 +- testsuite/systemtap.examples/io/ttyspy.stp | 4 ++-- testsuite/systemtap.examples/locks/bkl_stats.meta | 2 +- testsuite/systemtap.examples/locks/bkl_stats.stp | 10 ++-------- testsuite/systemtap.examples/memory/kmalloc-top.meta | 2 +- testsuite/systemtap.examples/memory/mmanonpage.meta | 2 +- testsuite/systemtap.examples/memory/mmreclaim.meta | 2 +- testsuite/systemtap.examples/memory/mmwriteback.meta | 2 +- testsuite/systemtap.examples/network/socket-trace.meta | 2 +- testsuite/systemtap.examples/network/tcpipstat.meta | 2 +- testsuite/systemtap.examples/process/errsnoop.stp | 3 +-- testsuite/systemtap.examples/process/forktracker.meta | 2 +- testsuite/systemtap.examples/process/forktracker.stp | 2 +- testsuite/systemtap.examples/process/schedtimes.meta | 2 +- testsuite/systemtap.examples/process/sigkill.meta | 2 +- testsuite/systemtap.examples/process/sleepingBeauties.meta | 2 +- testsuite/systemtap.examples/process/sleepingBeauties.stp | 2 +- testsuite/systemtap.examples/process/wait4time.stp | 5 +---- testsuite/systemtap.examples/profiling/latencytap.stp | 10 ++++------ 24 files changed, 29 insertions(+), 41 deletions(-) diff --git a/testsuite/systemtap.examples/general/badname.stp b/testsuite/systemtap.examples/general/badname.stp index 153e08c5..ba5a793c 100755 --- a/testsuite/systemtap.examples/general/badname.stp +++ b/testsuite/systemtap.examples/general/badname.stp @@ -1,4 +1,4 @@ -#!/usr/bin/stap -g +#!/usr/bin/env stap # badname.stp # Prevent the creation of files with undesirable names. # Source: http://blog.cuviper.com/2009/04/08/hacking-linux-filenames/ diff --git a/testsuite/systemtap.examples/general/grapher.stp b/testsuite/systemtap.examples/general/grapher.stp index 9079cb40..e8655b37 100755 --- a/testsuite/systemtap.examples/general/grapher.stp +++ b/testsuite/systemtap.examples/general/grapher.stp @@ -1,4 +1,4 @@ -#! /usr/bin/stap +#! /usr/bin/env stap probe begin { diff --git a/testsuite/systemtap.examples/general/graphs.stp b/testsuite/systemtap.examples/general/graphs.stp index f55d6cee..9e322820 100755 --- a/testsuite/systemtap.examples/general/graphs.stp +++ b/testsuite/systemtap.examples/general/graphs.stp @@ -1,4 +1,4 @@ -#! /usr/bin/stap +#! /usr/bin/env stap # ------------------------------------------------------------------------ # data collection diff --git a/testsuite/systemtap.examples/io/ioblktime.meta b/testsuite/systemtap.examples/io/ioblktime.meta index 01f34295..ff895a3f 100644 --- a/testsuite/systemtap.examples/io/ioblktime.meta +++ b/testsuite/systemtap.examples/io/ioblktime.meta @@ -8,6 +8,6 @@ status: production exit: user-controlled output: sorted-list scope: system-wide -description: The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. +description: The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. test_check: stap -p4 ioblktime.stp test_installcheck: stap ioblktime.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/iotime.meta b/testsuite/systemtap.examples/io/iotime.meta index cf22eacf..30e0599b 100644 --- a/testsuite/systemtap.examples/io/iotime.meta +++ b/testsuite/systemtap.examples/io/iotime.meta @@ -8,6 +8,6 @@ status: production exit: user-controlled output: trace scope: system-wide -description: The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls. +description: The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls. test_check: stap -p4 iotime.stp test_installcheck: stap iotime.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/iotime.stp b/testsuite/systemtap.examples/io/iotime.stp index 60fb09af..288e91d0 100755 --- a/testsuite/systemtap.examples/io/iotime.stp +++ b/testsuite/systemtap.examples/io/iotime.stp @@ -12,7 +12,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Print out the amount of time spent in the read and write systemcall - * when a process closes each file is closed. Note that the systemtap + * when each file opened by the process is closed. Note that the systemtap * script needs to be running before the open operations occur for * the script to record data. * diff --git a/testsuite/systemtap.examples/io/ttyspy.stp b/testsuite/systemtap.examples/io/ttyspy.stp index 272d82e9..0c98f391 100755 --- a/testsuite/systemtap.examples/io/ttyspy.stp +++ b/testsuite/systemtap.examples/io/ttyspy.stp @@ -1,11 +1,11 @@ -#! /usr/bin/stap -g +#! /usr/bin/env stap # May also need --skip-badvars global activity_time, activity_log /* Concatenate head and tail, to a max of @num chars, preferring to keep the tail (as if it were a recent history buffer). */ -function strcattail:string(head:string,tail:string,num:long) %{ +function strcattail:string(head:string,tail:string,num:long) %{ /* pure */ unsigned taillen = strlen(THIS->tail); unsigned headlen = strlen(THIS->head); unsigned maxlen = THIS->num < MAXSTRINGLEN ? THIS->num : MAXSTRINGLEN; diff --git a/testsuite/systemtap.examples/locks/bkl_stats.meta b/testsuite/systemtap.examples/locks/bkl_stats.meta index 16ac2911..e8080bf4 100644 --- a/testsuite/systemtap.examples/locks/bkl_stats.meta +++ b/testsuite/systemtap.examples/locks/bkl_stats.meta @@ -8,7 +8,7 @@ status: production exit: user-controlled output: sorted-list scope: system-wide -description: The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent holding the lock for each of the processes. +description: The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent in holding the lock for each of the processes. test_support: stap -l 'kernel.function("lock_kernel").return' test_check: stap -p4 bkl_stats.stp test_installcheck: stap bkl_stats.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/locks/bkl_stats.stp b/testsuite/systemtap.examples/locks/bkl_stats.stp index 4481e493..4a8eba6d 100755 --- a/testsuite/systemtap.examples/locks/bkl_stats.stp +++ b/testsuite/systemtap.examples/locks/bkl_stats.stp @@ -11,12 +11,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Print out the amount of time spent in the read and write systemcall - * when a process closes each file is closed. Note that the systemtap - * script needs to be running before the open operations occur for - * the script to record data. - * - * Description: displays statisics for waiting and holding big kernel lock (BKL) + * Description: displays statistics for waiting and holding big kernel lock (BKL) * * Run: stap bkl_stats.stap * @@ -73,11 +68,10 @@ probe kernel.function("lock_kernel").return { } probe kernel.function("unlock_kernel") { - # record the amount of time the process held the lock t = gettimeofday_us() s = holder_time[tid()] holder_time[tid()] = t - # record the amount of time waiting for the lock + # record the amount of time the process held the lock if (s) { holder_stats[tid()] <<< t - s names[tid()] = execname() diff --git a/testsuite/systemtap.examples/memory/kmalloc-top.meta b/testsuite/systemtap.examples/memory/kmalloc-top.meta index f4c2a9d1..6388c3e1 100644 --- a/testsuite/systemtap.examples/memory/kmalloc-top.meta +++ b/testsuite/systemtap.examples/memory/kmalloc-top.meta @@ -8,6 +8,6 @@ status: production exit: user-controlled output: sorted-list scope: system-wide -description: The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be be filtered to print only only the first stack traces (-t) stack traces with more a minimum counts (-m), or exclude certain stack traces (-e). +description: The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be filtered to print only the first N stack traces (-t), stack traces with a minimum counts (-m), or exclude certain stack traces (-e). test_check: ./kmalloc-top -o "-p4" -c "sleep 0" test_installcheck: ./kmalloc-top -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/memory/mmanonpage.meta b/testsuite/systemtap.examples/memory/mmanonpage.meta index 96ddd3a3..5e5cb843 100644 --- a/testsuite/systemtap.examples/memory/mmanonpage.meta +++ b/testsuite/systemtap.examples/memory/mmanonpage.meta @@ -8,7 +8,7 @@ status: experimental exit: user-controlled output: sorted-list scope: system-wide -description: The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. Its useful in debugging leaks in the anonymous regions of a process. +description: The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. It's useful in debugging leaks in the anonymous regions of a process. test_support: stap -l 'kernel.trace("mm_page_allocation"),kernel.trace("mm_page_free"),kernel.trace("mm_anon_fault"),kernel.trace("mm_anon_pgin"),kernel.trace("mm_anon_cow"),kernel.trace("mm_anon_unmap"),kernel.trace("mm_anon_userfree")' test_check: stap -p4 mmanonpage.stp test_installcheck: stap mmanonpage.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/memory/mmreclaim.meta b/testsuite/systemtap.examples/memory/mmreclaim.meta index 4b5c9de2..a2828574 100644 --- a/testsuite/systemtap.examples/memory/mmreclaim.meta +++ b/testsuite/systemtap.examples/memory/mmreclaim.meta @@ -8,7 +8,7 @@ status: experimental exit: user-controlled output: sorted-list scope: system-wide -description: The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. Its useful is debugging performance problems that occur due to page reclamation. +description: The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. It's useful in debugging performance problems that occur due to page reclamation. test_support: stap -l 'kernel.trace("mm_directreclaim_reclaimall"),kernel.trace("mm_pagereclaim_shrinkinactive"),kernel.trace("mm_pagereclaim_free"),kernel.trace("mm_pagereclaim_pgout"),kernel.trace("mm_pagereclaim_shrinkactive_a2a"),kernel.trace("mm_pagereclaim_shrinkinactive_i2a"),kernel.trace("mm_pagereclaim_shrinkactive_a2i"),kernel.trace("mm_pagereclaim_shrinkinactive_i2i")' test_check: stap -p4 mmreclaim.stp test_installcheck: stap mmreclaim.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/memory/mmwriteback.meta b/testsuite/systemtap.examples/memory/mmwriteback.meta index 76cc53a7..62b52cf9 100644 --- a/testsuite/systemtap.examples/memory/mmwriteback.meta +++ b/testsuite/systemtap.examples/memory/mmwriteback.meta @@ -8,7 +8,7 @@ status: experimental exit: user-controlled output: sorted-list scope: system-wide -description: The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. Its useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO. +description: The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It's useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO. test_support: stap -l 'kernel.trace("mm_pdflush_bgwriteout"),kernel.trace("mm_pdflush_kupdate"),kernel.trace("mm_pagereclaim_pgout")' test_check: stap -p4 mmwriteback.stp test_installcheck: stap mmwriteback.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/network/socket-trace.meta b/testsuite/systemtap.examples/network/socket-trace.meta index f73731b5..83af903c 100644 --- a/testsuite/systemtap.examples/network/socket-trace.meta +++ b/testsuite/systemtap.examples/network/socket-trace.meta @@ -8,6 +8,6 @@ status: production exit: user-controlled output: trace scope: system-wide -description: The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name. +description: The script instruments each of the functions in the Linux kernel's net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name. test_check: stap -p4 socket-trace.stp test_installcheck: stap socket-trace.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/network/tcpipstat.meta b/testsuite/systemtap.examples/network/tcpipstat.meta index 9e97ea5b..59cddaa8 100644 --- a/testsuite/systemtap.examples/network/tcpipstat.meta +++ b/testsuite/systemtap.examples/network/tcpipstat.meta @@ -9,7 +9,7 @@ exit: user-controlled output: timed scope: per-socket arg_[0-9]+: tcpstat.stp [index=laddr|raddr|lport|rport|tuple] [timeout=] [nozeros=1|0] [filters...] -description: tcpipstat collects and display network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simmer to that of the command netstat -s, only sorted and grouped by individual sockets. +description: tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets. test_support: stap -l 'tcpmib.InSegs' test_check: stap -p4 tcpipstat.stp test_installcheck: stap tcpipstat.stp timeout=1 diff --git a/testsuite/systemtap.examples/process/errsnoop.stp b/testsuite/systemtap.examples/process/errsnoop.stp index a3f17b77..4ad4ea1b 100755 --- a/testsuite/systemtap.examples/process/errsnoop.stp +++ b/testsuite/systemtap.examples/process/errsnoop.stp @@ -1,5 +1,4 @@ -#!/bin/sh -//usr/bin/env stap -DMAXMAPENTRIES=20480 $0 $@; exit $? +#!/usr/bin/env stap -DMAXMAPENTRIES=20480 $0 $@; exit $? # errsnoop.stp # Copyright (C) 2009 Red Hat, Inc., Eugene Teo # diff --git a/testsuite/systemtap.examples/process/forktracker.meta b/testsuite/systemtap.examples/process/forktracker.meta index 2ba3a659..21c5bc29 100644 --- a/testsuite/systemtap.examples/process/forktracker.meta +++ b/testsuite/systemtap.examples/process/forktracker.meta @@ -8,6 +8,6 @@ status: production exit: user-controlled output: trace scope: system-wide -description: The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes. +description: The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes. test_check: stap -p4 forktracker.stp test_installcheck: stap forktracker.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/process/forktracker.stp b/testsuite/systemtap.examples/process/forktracker.stp index 525aa0a5..f892ce17 100755 --- a/testsuite/systemtap.examples/process/forktracker.stp +++ b/testsuite/systemtap.examples/process/forktracker.stp @@ -1,7 +1,7 @@ #! /usr/bin/env stap # # This is a stap script to monitor process creations (fork(), exec()'s). -# Based off of stap script found: http://picobot.org/wordpress/?p=27 +# Based on stap script found: http://picobot.org/wordpress/?p=27 # With some minor modifications (i.e. timestamping) # # Usage: stap forktracker.stp diff --git a/testsuite/systemtap.examples/process/schedtimes.meta b/testsuite/systemtap.examples/process/schedtimes.meta index 5315042a..9386a3e8 100644 --- a/testsuite/systemtap.examples/process/schedtimes.meta +++ b/testsuite/systemtap.examples/process/schedtimes.meta @@ -8,7 +8,7 @@ status: production exit: user-controlled output: sorted-list scope: system-wide -description: The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID. +description: The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID. test_support: stap -l 'kernel.trace("sched_switch"),kernel.trace("sched_wakeup")' test_check: stap -p4 schedtimes.stp test_installcheck: stap schedtimes.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/process/sigkill.meta b/testsuite/systemtap.examples/process/sigkill.meta index b9c83f15..fed49a05 100644 --- a/testsuite/systemtap.examples/process/sigkill.meta +++ b/testsuite/systemtap.examples/process/sigkill.meta @@ -8,7 +8,7 @@ status: production exit: user-controlled output: trace scope: systemwide -description: The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name user ID that sent the signal. +description: The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name and user ID that sents the signal. arg_1: The name of the signal to look for on selected process. test_check: stap -p4 sigkill.stp test_installcheck: stap sigkill.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/process/sleepingBeauties.meta b/testsuite/systemtap.examples/process/sleepingBeauties.meta index b2692ba0..693a7789 100644 --- a/testsuite/systemtap.examples/process/sleepingBeauties.meta +++ b/testsuite/systemtap.examples/process/sleepingBeauties.meta @@ -2,6 +2,6 @@ title: Generating Backtraces of Threads Waiting for IO Operations name: sleepingBeauties.stp keywords: io scheduler backtrace subsystem: scheduler -description: The script monitors the time that threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. +description: The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. test_check: stap -p4 sleepingBeauties.stp test_installcheck: stap sleepingBeauties.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/process/sleepingBeauties.stp b/testsuite/systemtap.examples/process/sleepingBeauties.stp index 64c563a3..143fbe1c 100755 --- a/testsuite/systemtap.examples/process/sleepingBeauties.stp +++ b/testsuite/systemtap.examples/process/sleepingBeauties.stp @@ -1,4 +1,4 @@ -#! /usr/bin/stap +#! /usr/bin/env stap function time () { return gettimeofday_ms() } global time_name = "ms" diff --git a/testsuite/systemtap.examples/process/wait4time.stp b/testsuite/systemtap.examples/process/wait4time.stp index 2fd914b9..3e374b14 100755 --- a/testsuite/systemtap.examples/process/wait4time.stp +++ b/testsuite/systemtap.examples/process/wait4time.stp @@ -11,10 +11,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Print out the amount of time spent in the read and write systemcall - * when a process closes each file is closed. Note that the script needs - * to be running before the open operations occur for the script - * to record data. + * Print out the time spent in wait4 systemcall * * Format is: * timestamp pid (executabable) wait4: time_us pid diff --git a/testsuite/systemtap.examples/profiling/latencytap.stp b/testsuite/systemtap.examples/profiling/latencytap.stp index d202ec81..7fdbbc4e 100755 --- a/testsuite/systemtap.examples/profiling/latencytap.stp +++ b/testsuite/systemtap.examples/profiling/latencytap.stp @@ -1,4 +1,4 @@ -#! /usr/bin/stap -g +#! /usr/bin/env stap # Record the time that a process has spent asleep, and in what function @@ -7,8 +7,7 @@ global sleep_time global process_names global sleep_agg -function _get_sleep_time:long(rq_param:long, p_param:long) -%{ +function _get_sleep_time:long(rq_param:long, p_param:long) %{ /* pure */ struct rq *rq = (struct rq *)(unsigned long)THIS->rq_param; struct task_struct *p = (struct task_struct *)(unsigned long)THIS->p_param; struct sched_entity *se = &p->se; @@ -19,9 +18,8 @@ function _get_sleep_time:long(rq_param:long, p_param:long) THIS->__retvalue = delta; %} -# Get the backtrace from an arbitrary task -function task_backtrace:string (task:long) -%{ +# Get the backtrace from an arbitrary task +function task_backtrace:string (task:long) %{ /* pure */ _stp_stack_snprint_tsk(THIS->__retvalue, MAXSTRINGLEN, (struct task_struct *)(unsigned long)THIS->task, 0, MAXTRACE); %} -- cgit From f3c4da447c5b8746e2f756f2ed1dd16c7834bdb2 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 18 Nov 2009 14:28:25 +0100 Subject: Check in regenerated systemtap example indexes. --- testsuite/systemtap.examples/index.html | 26 +++--- testsuite/systemtap.examples/index.txt | 57 ++++++------ testsuite/systemtap.examples/keyword-index.html | 50 +++++------ testsuite/systemtap.examples/keyword-index.txt | 114 ++++++++++++------------ 4 files changed, 126 insertions(+), 121 deletions(-) diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index 19fddaa4..57cf0978 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -72,7 +72,7 @@ keywords: IO io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
      keywords: IO
      -

      The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

      +

      The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

    • io/iostat-scsi.stp - iostat for SCSI Devices
      keywords: IO PROFILING SCSI

      The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports.

    • @@ -81,7 +81,7 @@ keywords: IO io/iotime.stp - Trace Time Spent in Read and Write for Files
      keywords: SYSCALL READ WRITE TIME IO
      -

      The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      +

      The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

    • io/iotop.stp - Periodically Print I/O Activity by Process Name
      keywords: IO

      Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.

    • @@ -102,22 +102,22 @@ keywords: LOCKING

      The bkl.stp script can help determine whether the Big Kernel Lock (BKL) is causing serialization on a multiprocessor system due to excessive contention of the BKL. The bkl.stp script takes one argument which is the number of processes waiting for the Big Kernel Lock (BKL). When the number of processes waiting for the BKL is reached or exceeded, the script will print a time stamp, the number of processes waiting for the BKL, the holder of the BKL, and the amount of time the BKL was held.

    • locks/bkl_stats.stp - Per Process Statistics on Big Kernel Lock (BKL) Use
      keywords: LOCKING
      -

      The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent holding the lock for each of the processes.

    • +

      The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent in holding the lock for each of the processes.

    • memory/kmalloc-top - Show Paths to Kernel Malloc (kmalloc) Invocations
      keywords: MEMORY
      -

      The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be be filtered to print only only the first stack traces (-t) stack traces with more a minimum counts (-m), or exclude certain stack traces (-e).

    • +

      The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be filtered to print only the first N stack traces (-t), stack traces with a minimum counts (-m), or exclude certain stack traces (-e).

    • memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages
      keywords: MEMORY
      -

      The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. Its useful in debugging leaks in the anonymous regions of a process.

    • +

      The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. It's useful in debugging leaks in the anonymous regions of a process.

    • memory/mmfilepage.stp - Track Virtual Memory System Actions on File Backed Pages
      keywords: MEMORY

      The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.

    • memory/mmreclaim.stp - Track Virtual Memory System Page Reclamation
      keywords: MEMORY
      -

      The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. Its useful is debugging performance problems that occur due to page reclamation.

    • +

      The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. It's useful in debugging performance problems that occur due to page reclamation.

    • memory/mmwriteback.stp - Track Virtual Memory System Writing to Disk
      keywords: MEMORY
      -

      The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. Its useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.

    • +

      The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It's useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.

    • memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes
      keywords: MEMORY NUMA

      The numa_faults.stp script tracks the read and write pages faults for each process. When the script exits it prints out the total read and write pages faults for each process. The script also provide a break down of page faults per node for each process. This script is useful for determining whether the program has good locality (page faults limited to a single node) on a NUMA computer.

    • @@ -141,7 +141,7 @@ keywords: NETWORK network/socket-trace.stp - Trace Functions called in Network Socket Code
      keywords: NETWORK SOCKET
      -

      The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

      +

      The script instruments each of the functions in the Linux kernel's net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

    • network/tcp_connections.stp - Track Creation of Incoming TCP Connections
      keywords: NETWORK TCP SOCKET

      The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.

    • @@ -153,7 +153,7 @@ keywords: NETWORK network/tcpipstat.stp - Display network statistics for individual TCP sockets.
      keywords: NETWORK STATISTICS
      -

      tcpipstat collects and display network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simmer to that of the command netstat -s, only sorted and grouped by individual sockets.

      +

      tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets.

    • process/chng_cpu.stp - Monitor Changes in Processor Executing a Task
      keywords: SCHEDULER

      The chng_cpu.stp script takes an argument which is the executable name of the task it should monitor. Each time a task with that executable name is found running on a different processor, the script prints out the thread id (tid), the executable name, the processor now running the task, the thread state, and a backtrace showing the kernel functions that triggered the running of the task on the processor.

    • @@ -162,7 +162,7 @@ keywords: PROCESS process/forktracker.stp - Trace Creation of Processes
      keywords: PROCESS SCHEDULER
      -

      The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

      +

      The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes.

    • process/futexes.stp - System-Wide Futex Contention
      keywords: SYSCALL LOCKING FUTEX

      The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.

    • @@ -177,7 +177,7 @@ keywords: PROCESS

      The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.

    • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
      keywords: PROCESS SCHEDULER TIME TRACEPOINT
      -

      The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

    • +

      The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

    • process/sig_by_pid.stp - Signal Counts by Process ID
      keywords: SIGNALS

      Print signal counts by process ID in descending order.

    • @@ -186,13 +186,13 @@ keywords: SIGNALS

      Print signal counts by process name in descending order.

    • process/sigkill.stp - Track SIGKILL Signals
      keywords: SIGNALS
      -

      The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name user ID that sent the signal.

    • +

      The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name and user ID that sents the signal.

    • process/sigmon.stp - Track a particular signal to a specific process
      keywords: SIGNALS

      The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.

    • process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
      keywords: IO SCHEDULER BACKTRACE
      -

      The script monitors the time that threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

    • +

      The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

    • process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls
      keywords: SYSCALL SLEEP

      The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in parentheses, the "nanosleep:" key, and the duration of the sleep in microseconds.

    • diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index a18cae3f..56c18c34 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -87,9 +87,9 @@ keywords: io The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the - average time waiting time for block IO per device and prints list - every 10 seconds. In some cases there can be too many outstanding - block IO operations and the script may exceed the default number of + average waiting time for block IO per device and prints list every 10 + seconds. In some cases there can be too many outstanding block IO + operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. @@ -119,7 +119,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in @@ -190,7 +190,7 @@ keywords: locking waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the - time spent holding the lock for each of the processes. + time spent in holding the lock for each of the processes. memory/kmalloc-top - Show Paths to Kernel Malloc (kmalloc) Invocations @@ -199,9 +199,9 @@ keywords: memory The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it - prints out sorted list. The output can be be filtered to print only - only the first stack traces (-t) stack traces with more a minimum - counts (-m), or exclude certain stack traces (-e). + prints out sorted list. The output can be filtered to print only the + first N stack traces (-t), stack traces with a minimum counts (-m), + or exclude certain stack traces (-e). memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages @@ -213,7 +213,7 @@ keywords: memory the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the - script is active. Its useful in debugging leaks in the anonymous + script is active. It's useful in debugging leaks in the anonymous regions of a process. @@ -234,7 +234,7 @@ keywords: memory The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that - occurred while the script was running. Its useful is debugging + occurred while the script was running. It's useful in debugging performance problems that occur due to page reclamation. @@ -244,8 +244,8 @@ keywords: memory The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is - running. Its useful in determining where writes are coming from on a - supposedly idle system that is experiencing unexpected IO. + running. It's useful in determining where writes are coming from on + a supposedly idle system that is experiencing unexpected IO. memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes @@ -313,12 +313,12 @@ keywords: network tcp buffer memory network/socket-trace.stp - Trace Functions called in Network Socket Code keywords: network socket - The script instrument each of the functions inn the Linux kernel's - net/socket.c file. The script prints out trace. The first element of - a line is time delta in microseconds from the previous entry. This - is followed by the command name and the PID. The "->" and "<-" - indicates function entry and function exit, respectively. The last - element of the line is the function name. + The script instruments each of the functions in the Linux kernel's + net/socket.c file. The script prints out trace data. The first + element of a line is time delta in microseconds from the previous + entry. This is followed by the command name and the PID. The "->" and + "<-" indicates function entry and function exit, respectively. The + last element of the line is the function name. network/tcp_connections.stp - Track Creation of Incoming TCP Connections @@ -350,9 +350,9 @@ keywords: network traffic network/tcpipstat.stp - Display network statistics for individual TCP sockets. keywords: network statistics - tcpipstat collects and display network statistics related to + tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are - collected are simmer to that of the command netstat -s, only sorted + collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets. @@ -382,7 +382,7 @@ process/forktracker.stp - Trace Creation of Processes keywords: process scheduler The forktracker.stp script prints out a time-stamped entry showing - each fork and exec operation on the machine. This can be useful for + each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes. @@ -425,10 +425,11 @@ process/schedtimes.stp - Track Time Processes Spend in Various States using Trac keywords: process scheduler time tracepoint The schedtimes.stp script instruments the scheduler to track the - amount of time that each process spends running, sleeping, queued, - and waiting for io. On exit the script prints out the accumulated - time for each state of processes observed. Optionally, this script - can be used with the '-c' or '-x' options to focus on a specific PID. + amount of time that each process spends in running, sleeping, + queuing, and waiting for io. On exit the script prints out the + accumulated time for each state of processes observed. Optionally, + this script can be used with the '-c' or '-x' options to focus on a + specific PID. process/sig_by_pid.stp - Signal Counts by Process ID @@ -448,8 +449,8 @@ keywords: signals The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the - destination executable and process ID, the executable name user ID - that sent the signal. + destination executable and process ID, the executable name and user + ID that sents the signal. process/sigmon.stp - Track a particular signal to a specific process @@ -465,7 +466,7 @@ keywords: signals process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations keywords: io scheduler backtrace - The script monitors the time that threads spend waiting for IO + The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 05de73fa..f7f08597 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -56,7 +56,7 @@ keywords: IO process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
      keywords: IO SCHEDULER BACKTRACE
      -

      The script monitors the time that threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

      +

      The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

    BUFFER

      @@ -158,7 +158,7 @@ keywords: IO io/ioblktime.stp - Average Time Block IO Requests Spend in Queue
      keywords: IO
      -

      The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

      +

      The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line.

    • io/iostat-scsi.stp - iostat for SCSI Devices
      keywords: IO PROFILING SCSI

      The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports.

    • @@ -167,7 +167,7 @@ keywords: IO io/iotime.stp - Trace Time Spent in Read and Write for Files
      keywords: SYSCALL READ WRITE TIME IO
      -

      The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      +

      The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

    • io/iotop.stp - Periodically Print I/O Activity by Process Name
      keywords: IO

      Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.

    • @@ -185,7 +185,7 @@ keywords: IO process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
      keywords: IO SCHEDULER BACKTRACE
      -

      The script monitors the time that threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

      +

      The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

    LOCKING

      @@ -194,7 +194,7 @@ keywords: LOCKING

      The bkl.stp script can help determine whether the Big Kernel Lock (BKL) is causing serialization on a multiprocessor system due to excessive contention of the BKL. The bkl.stp script takes one argument which is the number of processes waiting for the Big Kernel Lock (BKL). When the number of processes waiting for the BKL is reached or exceeded, the script will print a time stamp, the number of processes waiting for the BKL, the holder of the BKL, and the amount of time the BKL was held.

    • locks/bkl_stats.stp - Per Process Statistics on Big Kernel Lock (BKL) Use
      keywords: LOCKING
      -

      The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent holding the lock for each of the processes.

    • +

      The bkl_stats.stp script can indicate which processes have excessive waits for the Big Kernel Lock (BKL) and which processes are taking the BKL for long periods of time. The bkl_stats.stp script prints lists of all the processes that require the BKL. Every five seconds two tables are printed out. The first table lists the processes that waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the time spent in holding the lock for each of the processes.

    • process/futexes.stp - System-Wide Futex Contention
      keywords: SYSCALL LOCKING FUTEX

      The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.

    • @@ -203,19 +203,19 @@ keywords: SYSCALL memory/kmalloc-top - Show Paths to Kernel Malloc (kmalloc) Invocations
      keywords: MEMORY
      -

      The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be be filtered to print only only the first stack traces (-t) stack traces with more a minimum counts (-m), or exclude certain stack traces (-e).

      +

      The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it prints out sorted list. The output can be filtered to print only the first N stack traces (-t), stack traces with a minimum counts (-m), or exclude certain stack traces (-e).

    • memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages
      keywords: MEMORY
      -

      The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. Its useful in debugging leaks in the anonymous regions of a process.

    • +

      The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. It's useful in debugging leaks in the anonymous regions of a process.

    • memory/mmfilepage.stp - Track Virtual Memory System Actions on File Backed Pages
      keywords: MEMORY

      The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.

    • memory/mmreclaim.stp - Track Virtual Memory System Page Reclamation
      keywords: MEMORY
      -

      The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. Its useful is debugging performance problems that occur due to page reclamation.

    • +

      The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occurred while the script was running. It's useful in debugging performance problems that occur due to page reclamation.

    • memory/mmwriteback.stp - Track Virtual Memory System Writing to Disk
      keywords: MEMORY
      -

      The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. Its useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.

    • +

      The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It's useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.

    • memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes
      keywords: MEMORY NUMA

      The numa_faults.stp script tracks the read and write pages faults for each process. When the script exits it prints out the total read and write pages faults for each process. The script also provide a break down of page faults per node for each process. This script is useful for determining whether the program has good locality (page faults limited to a single node) on a NUMA computer.

    • @@ -257,7 +257,7 @@ keywords: NETWORK network/socket-trace.stp - Trace Functions called in Network Socket Code
      keywords: NETWORK SOCKET
      -

      The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

      +

      The script instruments each of the functions in the Linux kernel's net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

    • network/tcp_connections.stp - Track Creation of Incoming TCP Connections
      keywords: NETWORK TCP SOCKET

      The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.

    • @@ -269,7 +269,7 @@ keywords: NETWORK network/tcpipstat.stp - Display network statistics for individual TCP sockets.
      keywords: NETWORK STATISTICS
      -

      tcpipstat collects and display network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simmer to that of the command netstat -s, only sorted and grouped by individual sockets.

      +

      tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets.

    NFS

      @@ -299,13 +299,13 @@ keywords: PROCESS process/forktracker.stp - Trace Creation of Processes
      keywords: PROCESS SCHEDULER
      -

      The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

      +

      The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes.

    • process/plimit.stp - print resource limits
      keywords: PROCESS

      The script prints a variety of resource limits for a given pid, like /proc/$$/limits on recent kernels.

    • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
      keywords: PROCESS SCHEDULER TIME TRACEPOINT
      -

      The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

    • +

      The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

    PROFILING

      @@ -338,7 +338,7 @@ keywords: PROFILING
      • io/iotime.stp - Trace Time Spent in Read and Write for Files
        keywords: SYSCALL READ WRITE TIME IO
        -

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      • +

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      SCHEDULER

        @@ -347,16 +347,16 @@ keywords: SCHEDULER

        The chng_cpu.stp script takes an argument which is the executable name of the task it should monitor. Each time a task with that executable name is found running on a different processor, the script prints out the thread id (tid), the executable name, the processor now running the task, the thread state, and a backtrace showing the kernel functions that triggered the running of the task on the processor.

      • process/forktracker.stp - Trace Creation of Processes
        keywords: PROCESS SCHEDULER
        -

        The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful for determine what process is creating a flurry of short-lived processes.

      • +

        The forktracker.stp script prints out a time-stamped entry showing each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes.

      • process/migrate.stp - Track the Migration of Specific Executables
        keywords: SCHEDULER

        The migrate.stp script takes an argument which is the executable name of the task it should monitor. Each time a task with that executable name migrates between processors an entry is printed with the process id (pid), the executable name, the processor off loading the task, and the process taking the task. Note that the task may or may not be executing at the time of the migration.

      • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
        keywords: PROCESS SCHEDULER TIME TRACEPOINT
        -

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

      • +

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

      • process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
        keywords: IO SCHEDULER BACKTRACE
        -

        The script monitors the time that threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

      • +

        The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay.

      SCSI

        @@ -374,7 +374,7 @@ keywords: SIGNALS

        Print signal counts by process name in descending order.

      • process/sigkill.stp - Track SIGKILL Signals
        keywords: SIGNALS
        -

        The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name user ID that sent the signal.

      • +

        The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the destination executable and process ID, the executable name and user ID that sents the signal.

      • process/sigmon.stp - Track a particular signal to a specific process
        keywords: SIGNALS

        The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.

      • @@ -395,7 +395,7 @@ keywords: SYSCALL network/socket-trace.stp - Trace Functions called in Network Socket Code
        keywords: NETWORK SOCKET
        -

        The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

        +

        The script instruments each of the functions in the Linux kernel's net/socket.c file. The script prints out trace data. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.

      • network/tcp_connections.stp - Track Creation of Incoming TCP Connections
        keywords: NETWORK TCP SOCKET

        The tcp_connections.stp script prints information for each new incoming TCP connection accepted by the computer. The information includes the UID, the command accepting the connection, the PID of the command, the port the connection is on, and the IP address of the originator of the request.

      • @@ -404,13 +404,13 @@ keywords: NETWORK network/tcpipstat.stp - Display network statistics for individual TCP sockets.
        keywords: NETWORK STATISTICS
        -

        tcpipstat collects and display network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simmer to that of the command netstat -s, only sorted and grouped by individual sockets.

        +

        tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets.

      SYSCALL

      • io/iotime.stp - Trace Time Spent in Read and Write for Files
        keywords: SYSCALL READ WRITE TIME IO
        -

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      • +

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      • process/errsnoop.stp - tabulate system call errors
        keywords: PROCESS SYSCALL

        The script prints a periodic tabular report about failing system calls, by process and by syscall failure. The first optional argument specifies the reporting interval (in seconds, default 5); the second optional argument gives a screen height (number of lines in the report, default 20).

      • @@ -443,10 +443,10 @@ keywords: NETWORK io/iotime.stp - Trace Time Spent in Read and Write for Files
        keywords: SYSCALL READ WRITE TIME IO
        -

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

        +

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      • process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
        keywords: PROCESS SCHEDULER TIME TRACEPOINT
        -

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

      • +

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

      TRACE

        @@ -464,7 +464,7 @@ keywords: NETWORK process/schedtimes.stp - Track Time Processes Spend in Various States using Tracepoints
        keywords: PROCESS SCHEDULER TIME TRACEPOINT
        -

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

        +

        The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends in running, sleeping, queuing, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.

      TRAFFIC

        @@ -500,7 +500,7 @@ keywords: SYSCALL io/iotime.stp - Trace Time Spent in Read and Write for Files
        keywords: SYSCALL READ WRITE TIME IO
        -

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

        +

        The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parentheses. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.

      diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 9ed52e27..d224d4ef 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -33,7 +33,7 @@ keywords: io backtrace process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations keywords: io scheduler backtrace - The script monitors the time that threads spend waiting for IO + The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. @@ -230,9 +230,9 @@ keywords: io The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the - average time waiting time for block IO per device and prints list - every 10 seconds. In some cases there can be too many outstanding - block IO operations and the script may exceed the default number of + average waiting time for block IO per device and prints list every 10 + seconds. In some cases there can be too many outstanding block IO + operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. @@ -262,7 +262,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in @@ -312,7 +312,7 @@ keywords: io tty per-process monitor process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations keywords: io scheduler backtrace - The script monitors the time that threads spend waiting for IO + The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. @@ -344,7 +344,7 @@ keywords: locking waited for the BKL followed by the number of times that the process waited, the minimum time of the wait, the average and the maximum time waited. The second table lists has similar information for the - time spent holding the lock for each of the processes. + time spent in holding the lock for each of the processes. process/futexes.stp - System-Wide Futex Contention @@ -364,9 +364,9 @@ keywords: memory The kmalloc-top perl program runs a small systemtap script to collect stack traces for each call to the kmalloc function and counts the time that each stack trace is observed. When kmalloc-top exits it - prints out sorted list. The output can be be filtered to print only - only the first stack traces (-t) stack traces with more a minimum - counts (-m), or exclude certain stack traces (-e). + prints out sorted list. The output can be filtered to print only the + first N stack traces (-t), stack traces with a minimum counts (-m), + or exclude certain stack traces (-e). memory/mmanonpage.stp - Track Virtual Memory System Actions on Anonymous Pages @@ -378,7 +378,7 @@ keywords: memory the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the - script is active. Its useful in debugging leaks in the anonymous + script is active. It's useful in debugging leaks in the anonymous regions of a process. @@ -399,7 +399,7 @@ keywords: memory The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that - occurred while the script was running. Its useful is debugging + occurred while the script was running. It's useful in debugging performance problems that occur due to page reclamation. @@ -409,8 +409,8 @@ keywords: memory The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is - running. Its useful in determining where writes are coming from on a - supposedly idle system that is experiencing unexpected IO. + running. It's useful in determining where writes are coming from on + a supposedly idle system that is experiencing unexpected IO. memory/numa_faults.stp - Summarize Process Misses across NUMA Nodes @@ -508,12 +508,12 @@ keywords: network tcp buffer memory network/socket-trace.stp - Trace Functions called in Network Socket Code keywords: network socket - The script instrument each of the functions inn the Linux kernel's - net/socket.c file. The script prints out trace. The first element of - a line is time delta in microseconds from the previous entry. This - is followed by the command name and the PID. The "->" and "<-" - indicates function entry and function exit, respectively. The last - element of the line is the function name. + The script instruments each of the functions in the Linux kernel's + net/socket.c file. The script prints out trace data. The first + element of a line is time delta in microseconds from the previous + entry. This is followed by the command name and the PID. The "->" and + "<-" indicates function entry and function exit, respectively. The + last element of the line is the function name. network/tcp_connections.stp - Track Creation of Incoming TCP Connections @@ -545,9 +545,9 @@ keywords: network traffic network/tcpipstat.stp - Display network statistics for individual TCP sockets. keywords: network statistics - tcpipstat collects and display network statistics related to + tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are - collected are simmer to that of the command netstat -s, only sorted + collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets. @@ -608,7 +608,7 @@ process/forktracker.stp - Trace Creation of Processes keywords: process scheduler The forktracker.stp script prints out a time-stamped entry showing - each fork and exec operation on the machine. This can be useful for + each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes. @@ -623,10 +623,11 @@ process/schedtimes.stp - Track Time Processes Spend in Various States using Trac keywords: process scheduler time tracepoint The schedtimes.stp script instruments the scheduler to track the - amount of time that each process spends running, sleeping, queued, - and waiting for io. On exit the script prints out the accumulated - time for each state of processes observed. Optionally, this script - can be used with the '-c' or '-x' options to focus on a specific PID. + amount of time that each process spends in running, sleeping, + queuing, and waiting for io. On exit the script prints out the + accumulated time for each state of processes observed. Optionally, + this script can be used with the '-c' or '-x' options to focus on a + specific PID. = PROFILING = @@ -716,7 +717,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in @@ -745,7 +746,7 @@ process/forktracker.stp - Trace Creation of Processes keywords: process scheduler The forktracker.stp script prints out a time-stamped entry showing - each fork and exec operation on the machine. This can be useful for + each fork and exec operation on the machine. This can be useful to determine what process is creating a flurry of short-lived processes. @@ -764,16 +765,17 @@ process/schedtimes.stp - Track Time Processes Spend in Various States using Trac keywords: process scheduler time tracepoint The schedtimes.stp script instruments the scheduler to track the - amount of time that each process spends running, sleeping, queued, - and waiting for io. On exit the script prints out the accumulated - time for each state of processes observed. Optionally, this script - can be used with the '-c' or '-x' options to focus on a specific PID. + amount of time that each process spends in running, sleeping, + queuing, and waiting for io. On exit the script prints out the + accumulated time for each state of processes observed. Optionally, + this script can be used with the '-c' or '-x' options to focus on a + specific PID. process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations keywords: io scheduler backtrace - The script monitors the time that threads spend waiting for IO + The script monitors the time that threads spend in waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms, its name and backtrace is printed, and later so is the total delay. @@ -808,8 +810,8 @@ keywords: signals The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the - destination executable and process ID, the executable name user ID - that sent the signal. + destination executable and process ID, the executable name and user + ID that sents the signal. process/sigmon.stp - Track a particular signal to a specific process @@ -848,12 +850,12 @@ keywords: syscall sleep network/socket-trace.stp - Trace Functions called in Network Socket Code keywords: network socket - The script instrument each of the functions inn the Linux kernel's - net/socket.c file. The script prints out trace. The first element of - a line is time delta in microseconds from the previous entry. This - is followed by the command name and the PID. The "->" and "<-" - indicates function entry and function exit, respectively. The last - element of the line is the function name. + The script instruments each of the functions in the Linux kernel's + net/socket.c file. The script prints out trace data. The first + element of a line is time delta in microseconds from the previous + entry. This is followed by the command name and the PID. The "->" and + "<-" indicates function entry and function exit, respectively. The + last element of the line is the function name. network/tcp_connections.stp - Track Creation of Incoming TCP Connections @@ -871,9 +873,9 @@ keywords: network tcp socket network/tcpipstat.stp - Display network statistics for individual TCP sockets. keywords: network statistics - tcpipstat collects and display network statistics related to + tcpipstat collects and displays network statistics related to individual TCP sockets or groups of sockets. The statistics that are - collected are simmer to that of the command netstat -s, only sorted + collected are simular to that of the command netstat -s, only sorted and grouped by individual sockets. @@ -884,7 +886,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in @@ -978,7 +980,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in @@ -993,10 +995,11 @@ process/schedtimes.stp - Track Time Processes Spend in Various States using Trac keywords: process scheduler time tracepoint The schedtimes.stp script instruments the scheduler to track the - amount of time that each process spends running, sleeping, queued, - and waiting for io. On exit the script prints out the accumulated - time for each state of processes observed. Optionally, this script - can be used with the '-c' or '-x' options to focus on a specific PID. + amount of time that each process spends in running, sleeping, + queuing, and waiting for io. On exit the script prints out the + accumulated time for each state of processes observed. Optionally, + this script can be used with the '-c' or '-x' options to focus on a + specific PID. = TRACE = @@ -1033,10 +1036,11 @@ process/schedtimes.stp - Track Time Processes Spend in Various States using Trac keywords: process scheduler time tracepoint The schedtimes.stp script instruments the scheduler to track the - amount of time that each process spends running, sleeping, queued, - and waiting for io. On exit the script prints out the accumulated - time for each state of processes observed. Optionally, this script - can be used with the '-c' or '-x' options to focus on a specific PID. + amount of time that each process spends in running, sleeping, + queuing, and waiting for io. On exit the script prints out the + accumulated time for each state of processes observed. Optionally, + this script can be used with the '-c' or '-x' options to focus on a + specific PID. = TRAFFIC = @@ -1104,7 +1108,7 @@ keywords: syscall read write time io The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the - amount of wall clock time spend in read and write operations and the + amount of wall clock time spent in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in -- cgit From f2107354d0a07d8f1d3bb3e97920ba557ebe7855 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 18 Nov 2009 10:59:37 -0600 Subject: PR 5150. Fixed nfs tapset by making probes optional. * tapset/nfs_proc.stp: Made 'nfs.proc.read', 'nfs.proc.write', and 'nfs.proc.commit' optional for newer kernels without those functions. * testsuite/systemtap.pass1-4/buildok.exp: Expect nfs-all-probes.stp to pass. --- tapset/nfs_proc.stp | 52 +++++++++++++++++++-------------- testsuite/systemtap.pass1-4/buildok.exp | 1 - 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/tapset/nfs_proc.stp b/tapset/nfs_proc.stp index 502091b4..afd5328b 100644 --- a/tapset/nfs_proc.stp +++ b/tapset/nfs_proc.stp @@ -207,9 +207,9 @@ function __getfh_inode :long(dir:long) %{ /* pure */ THIS->__retvalue =(long) fh; %} probe nfs.proc.entries = nfs.proc.lookup, - nfs.proc.read, - nfs.proc.write, - nfs.proc.commit, + nfs.proc.read ?, + nfs.proc.write ?, + nfs.proc.commit ?, nfs.proc.read_setup, nfs.proc.write_setup, nfs.proc.commit_setup, @@ -226,9 +226,9 @@ probe nfs.proc.entries = nfs.proc.lookup, probe nfs.proc.return = nfs.proc.lookup.return, - nfs.proc.read.return, - nfs.proc.write.return, - nfs.proc.commit.return, + nfs.proc.read.return ?, + nfs.proc.write.return ?, + nfs.proc.commit.return ?, nfs.proc.read_setup.return, nfs.proc.write_setup.return, nfs.proc.commit_setup.return, @@ -355,16 +355,18 @@ probe nfs.proc4.lookup.return = kernel.function("nfs4_proc_lookup").return!, * count : read bytes in this execution * offset : the file offset * +* All the nfs.proc.read kernel functions were removed in kernel commit +* 8e0969, so these probes are optional. */ -probe nfs.proc.read = nfs.proc2.read , - nfs.proc3.read , - nfs.proc4.read +probe nfs.proc.read = nfs.proc2.read ?, + nfs.proc3.read ?, + nfs.proc4.read ? {} -probe nfs.proc.read.return = nfs.proc2.read.return , - nfs.proc3.read.return , - nfs.proc4.read.return +probe nfs.proc.read.return = nfs.proc2.read.return ?, + nfs.proc3.read.return ?, + nfs.proc4.read.return ? { } @@ -464,17 +466,20 @@ probe nfs.proc4.read.return = kernel.function("nfs4_proc_read").return !, * bitmask0: * bitmask1 :V4 bitmask representing the set of attributes * supported on this filesystem (only in probe nfs.proc4.write) +* +* All the nfs.proc.write kernel functions were removed in kernel commit +* 200baa, so these probes are optional. */ -probe nfs.proc.write = nfs.proc2.write , - nfs.proc3.write , - nfs.proc4.write +probe nfs.proc.write = nfs.proc2.write ?, + nfs.proc3.write ?, + nfs.proc4.write ? {} -probe nfs.proc.write.return = nfs.proc2.write.return , - nfs.proc3.write.return , - nfs.proc4.write.return +probe nfs.proc.write.return = nfs.proc2.write.return ?, + nfs.proc3.write.return ?, + nfs.proc4.write.return ? {} probe nfs.proc2.write = kernel.function("nfs_proc_write")!, @@ -598,13 +603,16 @@ probe nfs.proc4.write.return = kernel.function("nfs4_proc_write").return !, * bitmask0: * bitmask1 :V4 bitmask representing the set of attributes * supported on this filesystem (only in probe nfs.proc4.commit) +* +* All the nfs.proc.commit kernel functions were removed in kernel +* commit 200baa, so these probes are optional. */ -probe nfs.proc.commit = nfs.proc3.commit, - nfs.proc4.commit +probe nfs.proc.commit = nfs.proc3.commit ?, + nfs.proc4.commit ? {} -probe nfs.proc.commit.return = nfs.proc3.commit.return, - nfs.proc4.commit.return +probe nfs.proc.commit.return = nfs.proc3.commit.return ?, + nfs.proc4.commit.return ? {} // XXX: on kernels > 2.6.18 (?), module("nfs") -> module("nfsd") and diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp index 8ab8b139..b03ea8fc 100644 --- a/testsuite/systemtap.pass1-4/buildok.exp +++ b/testsuite/systemtap.pass1-4/buildok.exp @@ -9,7 +9,6 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { buildok/sched_test.stp {setup_kfail 1155 *-*-*} buildok/process_test.stp {setup_kfail 1155 *-*-*} buildok/rpc-all-probes.stp {setup_kfail 4413 *-*-*} - buildok/nfs-all-probes.stp {setup_kfail 4413 *-*-*} buildok/per-process-syscall.stp {if {![utrace_p]} { setup_kfail 9999 *-*-*} } } if {$rc == 0} { pass $test } else { fail $test } -- cgit From c3425989053b94d526ab7647eb0ffc260daf4ff2 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 18 Nov 2009 11:16:15 -0600 Subject: Don't kfail buildok/sched_test.stp and buildok/process_test.stp. * testsuite/systemtap.pass1-4/buildok.exp: On rhel5 and rawhide, the buildok/sched_test.stp and buildok/process_test.stp tests pass sucessfully, so there is no reason to kfail them. --- testsuite/systemtap.pass1-4/buildok.exp | 2 -- 1 file changed, 2 deletions(-) diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp index b03ea8fc..a9f16a8b 100644 --- a/testsuite/systemtap.pass1-4/buildok.exp +++ b/testsuite/systemtap.pass1-4/buildok.exp @@ -6,8 +6,6 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { # some tests are known to fail. switch $test { buildok/perfmon01.stp {setup_kfail 909 *-*-*} - buildok/sched_test.stp {setup_kfail 1155 *-*-*} - buildok/process_test.stp {setup_kfail 1155 *-*-*} buildok/rpc-all-probes.stp {setup_kfail 4413 *-*-*} buildok/per-process-syscall.stp {if {![utrace_p]} { setup_kfail 9999 *-*-*} } } -- cgit From 02a2d6ca6f9120cc39cc1eb5ffe089b88dd4d818 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 18 Nov 2009 12:53:50 -0600 Subject: PR 10981. Fixed buildok/netdev.stp for RHEL5. * tapset/networking.stp: Made 'netdev.change_rx_flag' and 'netdev.get_stats' optional, since those functions don't exist on RHEL5. * testsuite/buildok/netdev.stp: Ditto. --- tapset/networking.stp | 4 ++-- testsuite/buildok/netdev.stp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tapset/networking.stp b/tapset/networking.stp index e9ea35dc..e1c5ed1f 100644 --- a/tapset/networking.stp +++ b/tapset/networking.stp @@ -154,7 +154,7 @@ probe netdev.rx * @flags: The new flags */ probe netdev.change_rx_flag - = kernel.function("dev_change_rx_flags") + = kernel.function("dev_change_rx_flags") ? { dev_name = get_netdev_name($dev) flags = $flags @@ -217,7 +217,7 @@ probe netdev.unregister * @dev_name: The device that is going to provide the statistics */ probe netdev.get_stats - = kernel.function("dev_get_stats") + = kernel.function("dev_get_stats") ? { dev_name = get_netdev_name($dev) } diff --git a/testsuite/buildok/netdev.stp b/testsuite/buildok/netdev.stp index 49a1eb5c..7e4be82c 100755 --- a/testsuite/buildok/netdev.stp +++ b/testsuite/buildok/netdev.stp @@ -1,6 +1,6 @@ #! stap -wp4 -probe netdev.get_stats{ +probe netdev.get_stats ? { printf("%s", dev_name) } @@ -21,7 +21,7 @@ probe netdev.set_promiscuity { disable, inc) } -probe netdev.change_rx_flag { +probe netdev.change_rx_flag ? { printf("%s %d", dev_name, flags) } -- cgit From 508968a7d10bbae3b9fbc33bf3d3b1e62a8a018a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 18 Nov 2009 13:32:22 -0800 Subject: PR10983: Give preference to tracepoints in trace/events/ In 2.6.32-rc7, there are two power.h tracepoints headers, and only the one in trace/events/ is valid. In general, we can expect that trace/events/ has newer headers, so we should search those first. * tapsets.cxx (tracepoint_builder::init_dw): Search /events/ first. --- tapsets.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index c972de5f..7bae4615 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -6313,10 +6313,10 @@ tracepoint_builder::init_dw(systemtap_session& s) glob_t trace_glob; string globs[] = { - "/include/trace/*.h", "/include/trace/events/*.h", - "/source/include/trace/*.h", "/source/include/trace/events/*.h", + "/include/trace/*.h", + "/source/include/trace/*.h", }; for (unsigned z = 0; z < sizeof(globs) / sizeof(globs[0]); z++) { -- cgit From 34642a03789b139d9e33253ab42744852199af1f Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 20 Nov 2009 11:55:28 -0500 Subject: build: disable make-silent mode in rpm builds --- systemtap.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemtap.spec b/systemtap.spec index d7cdc61b..1ccf6751 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -241,7 +241,7 @@ cd .. %endif -%configure %{?elfutils_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{grapher_config} %{rpm_config} +%configure %{?elfutils_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{grapher_config} %{rpm_config} --disable-silent-rules make %{?_smp_mflags} %install -- cgit From e9b2a22da6a5a4cc49b410681bd5cf228f1e8fc3 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 20 Nov 2009 13:02:38 -0500 Subject: cleanup: explain -5 magic value used in map-sorting code --- runtime/map.c | 2 +- translate.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/map.c b/runtime/map.c index 74467f30..20d8a48c 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -412,7 +412,7 @@ static void _stp_pmap_del(PMAP pmap) } /* sort keynum values */ -#define SORT_COUNT -5 +#define SORT_COUNT -5 /* see also translate.cxx:visit_foreach_loop */ #define SORT_SUM -4 #define SORT_MIN -3 #define SORT_MAX -2 diff --git a/translate.cxx b/translate.cxx index ca298113..03f7c86a 100644 --- a/translate.cxx +++ b/translate.cxx @@ -2611,7 +2611,7 @@ c_unparser::visit_foreach_loop (foreach_loop *s) // @count instead for aggregates. '-5' tells the // runtime to sort by count. if (s->sort_column == 0) - sort_column = -5; + sort_column = -5; /* runtime/map.c SORT_COUNT */ else sort_column = s->sort_column; -- cgit From 4eea0069b8b677657dcfea3effa2f342d0e5d27f Mon Sep 17 00:00:00 2001 From: Prerna Saxena Date: Sun, 22 Nov 2009 23:40:39 +0530 Subject: Added tracepoint-based probes to block IO and IO scheduler tapsets. Added testcases for these probes. Also, modified comments in ioblock.stp so that tapset docmentation can be automatically generated for this tapset. --- doc/SystemTap_Tapset_Reference/tapsets.tmpl | 5 +- tapset/ioblock.stp | 221 ++++++++++++++++++++++------ tapset/ioscheduler.stp | 191 +++++++++++++++++++++++- testsuite/buildok/ioblock_test.stp | 7 + testsuite/buildok/ioscheduler.stp | 13 ++ 5 files changed, 385 insertions(+), 52 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/tapsets.tmpl b/doc/SystemTap_Tapset_Reference/tapsets.tmpl index addcf88d..bb855d29 100644 --- a/doc/SystemTap_Tapset_Reference/tapsets.tmpl +++ b/doc/SystemTap_Tapset_Reference/tapsets.tmpl @@ -167,12 +167,13 @@ - IO Scheduler Tapset + IO Scheduler and block IO Tapset - This family of probe points is used to probe IO scheduler activities. + This family of probe points is used to probe block IO layer and IO scheduler activities. It contains the following probe points: !Itapset/ioscheduler.stp +!Itapset/ioblock.stp diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp index bc64c425..1bc06699 100644 --- a/tapset/ioblock.stp +++ b/tapset/ioblock.stp @@ -78,18 +78,13 @@ function __bio_devname:string(bio:long) global BIO_READ = 0, BIO_WRITE = 1 -/* probe ioblock.request +/** + * probe ioblock.request - Fires whenever making a generic block I/O request. * - * Fires whenever making a generic block I/O request. - * - * Context: - * The process makes block I/O request - * - * Variables: - * devname - block device name - * ino - i-node number of the mapped file - * sector - beginning sector for the entire bio - * flags - see below + * @devname - block device name + * @ino - i-node number of the mapped file + * @sector - beginning sector for the entire bio + * @flags - see below * BIO_UPTODATE 0 ok after I/O completion * BIO_RW_BLOCK 1 RW_AHEAD set, and read/write would block * BIO_EOF 2 out-out-bounds error @@ -99,20 +94,18 @@ global BIO_READ = 0, BIO_WRITE = 1 * BIO_USER_MAPPED 6 contains user pages * BIO_EOPNOTSUPP 7 not supported * - * rw - binary trace for read/write request - * vcnt - bio vector count which represents number of array element (page, - * offset, length) which make up this I/O request - * idx - offset into the bio vector array - * phys_segments - number of segments in this bio after physical address - * coalescing is performed. - * hw_segments - number of segments after physical and DMA remapping - * hardware coalescing is performed - * size - total size in bytes - * bdev - target block device - * bdev_contains - points to the device object which contains the - * partition (when bio structure represents a partition) - * p_start_sect - points to the start sector of the partition - * structure of the device + * @rw - binary trace for read/write request + * @vcnt - bio vector count which represents number of array element (page, offset, length) which make up this I/O request + * @idx - offset into the bio vector array + * @phys_segments - number of segments in this bio after physical address coalescing is performed + * @hw_segments - number of segments after physical and DMA remapping hardware coalescing is performed + * @size - total size in bytes + * @bdev - target block device + * @bdev_contains - points to the device object which contains the partition (when bio structure represents a partition) + * @p_start_sect - points to the start sector of the partition structure of the device + * + * Context: + * The process makes block I/O request */ probe ioblock.request = kernel.function ("generic_make_request") { @@ -135,19 +128,14 @@ probe ioblock.request = kernel.function ("generic_make_request") p_start_sect = __bio_start_sect($bio) } -/* probe ioblock.end - * - * Fires whenever a block I/O transfer is complete. - * - * Context: - * The process signals the transfer is done. +/** + * probe ioblock.end - Fires whenever a block I/O transfer is complete. * - * Variables: - * devname - block device name - * ino - i-node number of the mapped file - * byte_done - number of bytes transferred - * sector - beginning sector for the entire bio - * flags - see below + * @devname - block device name + * @ino - i-node number of the mapped file + * @bytes_done - number of bytes transferred + * @sector - beginning sector for the entire bio + * @flags - see below * BIO_UPTODATE 0 ok after I/O completion * BIO_RW_BLOCK 1 RW_AHEAD set, and read/write would block * BIO_EOF 2 out-out-bounds error @@ -156,16 +144,16 @@ probe ioblock.request = kernel.function ("generic_make_request") * BIO_BOUNCED 5 bio is a bounce bio * BIO_USER_MAPPED 6 contains user pages * BIO_EOPNOTSUPP 7 not supported - * error - 0 on success - * rw - binary trace for read/write request - * vcnt - bio vector count which represents number of array element (page, - * offset, length) which makes up this I/O request - * idx - offset into the bio vector array - * phys_segments - number of segments in this bio after physical address - * coalescing is performed. - * hw_segments - number of segments after physical and DMA remapping - * hardware coalescing is performed - * size - total size in bytes + * @error - 0 on success + * @rw - binary trace for read/write request + * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request + * @idx - offset into the bio vector array + * @phys_segments - number of segments in this bio after physical address coalescing is performed. + * @hw_segments - number of segments after physical and DMA remapping hardware coalescing is performed + * @size - total size in bytes + * + * Context: + * The process signals the transfer is done. */ probe ioblock.end = kernel.function("bio_endio") { @@ -186,3 +174,142 @@ probe ioblock.end = kernel.function("bio_endio") %) size = $bio->bi_size } + +/** + * probe ioblock_trace.bounce - Fires whenever a buffer bounce is needed for at least one page of a block IO request. + * + * @bio struct bio * + * @q struct request_queue* + * @devname device for which a buffer bounce was needed. + * @ino - i-node number of the mapped file + * @bytes_done - number of bytes transferred + * @sector - beginning sector for the entire bio + * @flags - see below + * BIO_UPTODATE 0 ok after I/O completion + * BIO_RW_BLOCK 1 RW_AHEAD set, and read/write would block + * BIO_EOF 2 out-out-bounds error + * BIO_SEG_VALID 3 nr_hw_seg valid + * BIO_CLONED 4 doesn't own data + * BIO_BOUNCED 5 bio is a bounce bio + * BIO_USER_MAPPED 6 contains user pages + * BIO_EOPNOTSUPP 7 not supported + * @error - 0 on success + * @rw - binary trace for read/write request + * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request + * @idx - offset into the bio vector array + * @phys_segments - number of segments in this bio after physical address coalescing is performed. + * @size - total size in bytes + * + * Context : + * The process creating a block IO request. + */ +probe ioblock_trace.bounce = kernel.trace("block_bio_bounce") +{ + devname = __bio_devname($bio) + ino = __bio_ino($bio) + + bytes_done = $bio->bi_size + sector = $bio->bi_sector + flags = $bio->bi_flags + rw = $bio->bi_rw + vcnt = $bio->bi_vcnt + idx = $bio->bi_idx + phys_segments = $bio->bi_phys_segments + size = $bio->bi_size +} + +/** + * probe ioblock_trace.request - Fires just as a generic block I/O request is created for a bio. + * + * @bio struct bio* for which IO request is to be submitted + * @q struct request_queue* to which the request is to be added + * @devname - block device name + * @ino - i-node number of the mapped file + * @sector - beginning sector for the entire bio + * @flags - see below + * BIO_UPTODATE 0 ok after I/O completion + * BIO_RW_BLOCK 1 RW_AHEAD set, and read/write would block + * BIO_EOF 2 out-out-bounds error + * BIO_SEG_VALID 3 nr_hw_seg valid + * BIO_CLONED 4 doesn't own data + * BIO_BOUNCED 5 bio is a bounce bio + * BIO_USER_MAPPED 6 contains user pages + * BIO_EOPNOTSUPP 7 not supported + * + * @rw - binary trace for read/write request + * @vcnt - bio vector count which represents number of array element (page, offset, length) which make up this I/O request + * @idx - offset into the bio vector array + * @phys_segments - number of segments in this bio after physical address coalescing is performed. + * @size - total size in bytes + * @bdev - target block device + * @bdev_contains - points to the device object which contains the partition (when bio structure represents a partition) + * @p_start_sect - points to the start sector of the partition structure of the device + * + * Context: + * The process makes block I/O request + */ + +probe ioblock_trace.request = kernel.trace("block_bio_queue") +{ + devname = __bio_devname($bio) + ino = __bio_ino($bio) + + bytes_done = $bio->bi_size + error = $error + sector = $bio->bi_sector + flags = $bio->bi_flags + rw = $bio->bi_rw + vcnt = $bio->bi_vcnt + idx = $bio->bi_idx + phys_segments = $bio->bi_phys_segments + size = $bio->bi_size + bdev_contains = $bio->bi_bdev->bd_contains + bdev = $bio->bi_bdev + p_start_sect = __bio_start_sect($bio) +} + +/** + * probe ioblock_trace.end - Fires whenever a block I/O transfer is complete. + * + * @q - request queue on which this bio was queued. + * @devname - block device name + * @ino - i-node number of the mapped file + * @bytes_done - number of bytes transferred + * @sector - beginning sector for the entire bio + * @flags - see below + * BIO_UPTODATE 0 ok after I/O completion + * BIO_RW_BLOCK 1 RW_AHEAD set, and read/write would block + * BIO_EOF 2 out-out-bounds error + * BIO_SEG_VALID 3 nr_hw_seg valid + * BIO_CLONED 4 doesn't own data + * BIO_BOUNCED 5 bio is a bounce bio + * BIO_USER_MAPPED 6 contains user pages + * BIO_EOPNOTSUPP 7 not supported + + * @error - 0 on success + * @rw - binary trace for read/write request + * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request + * @idx - offset into the bio vector array + * @phys_segments - number of segments in this bio after physical address coalescing is performed. + * @size - total size in bytes + * + * Context: + * The process signals the transfer is done. + */ +probe ioblock_trace.end = kernel.trace("block_bio_complete") +{ + q = $q + devname = __bio_devname($bio) + ino = __bio_ino($bio) + + bytes_done = $bio->bi_size + error = $error + + sector = $bio->bi_sector + flags = $bio->bi_flags + rw = $bio->bi_rw + vcnt = $bio->bi_vcnt + idx = $bio->bi_idx + phys_segments = $bio->bi_phys_segments + size = $bio->bi_size +} diff --git a/tapset/ioscheduler.stp b/tapset/ioscheduler.stp index 637e2783..ac271f80 100644 --- a/tapset/ioscheduler.stp +++ b/tapset/ioscheduler.stp @@ -68,22 +68,24 @@ probe ioscheduler.elv_next_request.return } /** - * probe ioscheduler.elv_add_request - A request was added to the request queue + * probe ioscheduler.elv_add_request.kp - kprobe based probe to indicate that a request was added to the request queue * @elevator_name: The type of I/O elevator currently enabled + * @q: pointer to request queue * @req: Address of the request * @req_flags: Request flags * @disk_major: Disk major number of the request * @disk_minor: Disk minor number of the request */ // when a request is added to the request queue -probe ioscheduler.elv_add_request - = kernel.function("__elv_add_request") +probe ioscheduler.elv_add_request.kp + = kernel.function("elv_insert") { %( kernel_v >= "2.6.10" %? elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) %: elevator_name = kernel_string($q->elevator->elevator_name) %) + q = $q if($rq == 0) { disk_major = -1 disk_minor = -1 @@ -142,6 +144,189 @@ probe ioscheduler.elv_completed_request %) } +/** + * probe ioscheduler.elv_add_request.tp : tracepoint based probe to indicate a request is added to the request queue. + * @elevator_name : The type of I/O elevator currently enabled. + * @q : Pointer to request queue. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler.elv_add_request.tp + = kernel.trace("block_rq_insert") +{ +q = $q +elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) +rq = $rq + +if ($rq == 0 || $rq->rq_disk ==0) { + disk_major = -1 + disk_minor = -1 +} else { + disk_major = $rq->rq_disk->major + disk_minor = $rq->rq_disk->first_minor +} + +rq_flags = $rq==0? 0:$rq->cmd_flags +} + +/** + * probe ioscheduler.elv_add_request : probe to indicate request is added to the request queue. + * @elevator_name : The type of I/O elevator currently enabled. + * @q : Pointer to request queue. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler.elv_add_request = + ioscheduler.elv_add_request.tp !, ioscheduler.elv_add_request.kp +{} + +/** + * probe ioscheduler_trace.elv_completed_request : Fires when a request is + * completed. + * @elevator_name : The type of I/O elevator currently enabled. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler_trace.elv_completed_request + = kernel.trace("block_rq_complete") +{ +elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) +rq = $rq + +if ($rq == 0 || $rq->rq_disk ==0) { + disk_major = -1 + disk_minor = -1 +} else { + disk_major = $rq->rq_disk->major + disk_minor = $rq->rq_disk->first_minor +} + +rq_flags = $rq==0? 0:$rq->cmd_flags +} + +/** + * probe ioscheduler_trace.elv_issue_request : Fires when a request is + * scheduled. + * @elevator_name : The type of I/O elevator currently enabled. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler_trace.elv_issue_request + = kernel.trace("block_rq_issue") +{ +elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) +rq = $rq + +if ($rq == 0 || $rq->rq_disk ==0) { + disk_major = -1 + disk_minor = -1 +} else { + disk_major = $rq->rq_disk->major + disk_minor = $rq->rq_disk->first_minor +} + +rq_flags = $rq==0? 0:$rq->cmd_flags +} + +/** + * probe ioscheduler_trace.elv_requeue_request : Fires when a request is + * put back on the queue, when the hadware cannot accept more requests. + * @elevator_name : The type of I/O elevator currently enabled. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler_trace.elv_requeue_request + = kernel.trace("block_rq_requeue") +{ +elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) +rq = $rq + +if ($rq == 0 || $rq->rq_disk ==0) { + disk_major = -1 + disk_minor = -1 +} else { + disk_major = $rq->rq_disk->major + disk_minor = $rq->rq_disk->first_minor +} + +rq_flags = $rq==0? 0:$rq->cmd_flags +} + +/** + * probe ioscheduler_trace.elv_abort_request : Fires when a request is aborted. + * @elevator_name : The type of I/O elevator currently enabled. + * @rq : Address of request. + * @rq_flags : Request flags. + * @disk_major : Disk major no of request. + * @disk_minor : Disk minor number of request. + * + */ +probe ioscheduler_trace.elv_abort_request + = kernel.trace("block_rq_abort") +{ +elevator_name = kernel_string($q->elevator->elevator_type->elevator_name) +rq = $rq + +if ($rq == 0 || $rq->rq_disk ==0) { + disk_major = -1 + disk_minor = -1 +} else { + disk_major = $rq->rq_disk->major + disk_minor = $rq->rq_disk->first_minor +} + +rq_flags = $rq==0? 0:$rq->cmd_flags +} + +/** + * probe ioscheduler_trace.plug - Fires when a request queue is plugged; + * ie, requests in the queue cannot be serviced by block driver. + * @rq_queue : request queue + * + */ +probe ioscheduler_trace.plug = kernel.trace("block_plug") +{ + rq_queue = $q +} + +/** + * probe ioscheduler_trace.unplug_io - Fires when a request queue is unplugged; + * Either, when number of pending requests in the queue exceeds threshold + * or, upon expiration of timer that was activated when queue was plugged. + * @rq_queue : request queue + * + */ +probe ioscheduler_trace.unplug_io = kernel.trace("block_unplug_io") +{ + rq_queue = $q +} + +/** + * probe ioscheduler_trace.unplug_timer - Fires when unplug timer associated + * with a request queue expires. + * @rq_queue : request queue + * + */ +probe ioscheduler_trace.unplug_timer = kernel.trace("block_unplug_timer") +{ + rq_queue = $q +} + function disk_major_from_request:long(var_q:long) %{ /* pure */ struct request_queue *q = (struct request_queue *)((long)THIS->var_q); diff --git a/testsuite/buildok/ioblock_test.stp b/testsuite/buildok/ioblock_test.stp index 4d3dadfa..55237994 100755 --- a/testsuite/buildok/ioblock_test.stp +++ b/testsuite/buildok/ioblock_test.stp @@ -25,3 +25,10 @@ probe ioblock.end { devname, sector, flags, rw, bio_rw_str(rw), vcnt, idx, phys_segments, size, bytes_done, error, ino) %) } + +probe ioblock_trace.* +{ + log(pp()) + printf("%s\t%p\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", + devname, q, sector, flags, rw, bio_rw_str(rw), vcnt, idx, phys_segments, size, bytes_done, error, ino) +} diff --git a/testsuite/buildok/ioscheduler.stp b/testsuite/buildok/ioscheduler.stp index 2d88d2d5..55ef9a0f 100755 --- a/testsuite/buildok/ioscheduler.stp +++ b/testsuite/buildok/ioscheduler.stp @@ -7,3 +7,16 @@ probe ioscheduler.* printf("ppname: %s, elv_name: %s, %d, %d", probefunc(), elevator_name, disk_major, disk_minor) } + +probe ioscheduler_trace.elv* +{ + printf("ppname: %s, request %p, elv_name: %s, %d, %d", probefunc(), + rq, elevator_name, disk_major, disk_minor) +} + +probe ioscheduler_trace.plug, ioscheduler_trace.unplug_io, ioscheduler_trace.unplug_timer +{ + printf("ppname: %s, request %p, elv_name: %s, %d, %d", probefunc(), + rq_queue) +} + -- cgit From b28d67e28087f208ecfd888b4518bb9efb2bf552 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 23 Nov 2009 14:03:33 +0800 Subject: Correct block IO and IO scheduler tapset and test case * tapset/ioblock.stp: Update comment and variables. * testsuite/buildok/ioblock_test.stp: Add parameters. * testsuite/buildok/ioscheduler.stp: Remove redundant parameters. --- tapset/ioblock.stp | 9 +-------- testsuite/buildok/ioblock_test.stp | 4 ++-- testsuite/buildok/ioscheduler.stp | 3 +-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp index 1bc06699..707fad4c 100644 --- a/tapset/ioblock.stp +++ b/tapset/ioblock.stp @@ -178,8 +178,6 @@ probe ioblock.end = kernel.function("bio_endio") /** * probe ioblock_trace.bounce - Fires whenever a buffer bounce is needed for at least one page of a block IO request. * - * @bio struct bio * - * @q struct request_queue* * @devname device for which a buffer bounce was needed. * @ino - i-node number of the mapped file * @bytes_done - number of bytes transferred @@ -193,7 +191,6 @@ probe ioblock.end = kernel.function("bio_endio") * BIO_BOUNCED 5 bio is a bounce bio * BIO_USER_MAPPED 6 contains user pages * BIO_EOPNOTSUPP 7 not supported - * @error - 0 on success * @rw - binary trace for read/write request * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request * @idx - offset into the bio vector array @@ -221,10 +218,9 @@ probe ioblock_trace.bounce = kernel.trace("block_bio_bounce") /** * probe ioblock_trace.request - Fires just as a generic block I/O request is created for a bio. * - * @bio struct bio* for which IO request is to be submitted - * @q struct request_queue* to which the request is to be added * @devname - block device name * @ino - i-node number of the mapped file + * @bytes_done - number of bytes transferred * @sector - beginning sector for the entire bio * @flags - see below * BIO_UPTODATE 0 ok after I/O completion @@ -255,7 +251,6 @@ probe ioblock_trace.request = kernel.trace("block_bio_queue") ino = __bio_ino($bio) bytes_done = $bio->bi_size - error = $error sector = $bio->bi_sector flags = $bio->bi_flags rw = $bio->bi_rw @@ -286,7 +281,6 @@ probe ioblock_trace.request = kernel.trace("block_bio_queue") * BIO_USER_MAPPED 6 contains user pages * BIO_EOPNOTSUPP 7 not supported - * @error - 0 on success * @rw - binary trace for read/write request * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request * @idx - offset into the bio vector array @@ -303,7 +297,6 @@ probe ioblock_trace.end = kernel.trace("block_bio_complete") ino = __bio_ino($bio) bytes_done = $bio->bi_size - error = $error sector = $bio->bi_sector flags = $bio->bi_flags diff --git a/testsuite/buildok/ioblock_test.stp b/testsuite/buildok/ioblock_test.stp index 55237994..21595021 100755 --- a/testsuite/buildok/ioblock_test.stp +++ b/testsuite/buildok/ioblock_test.stp @@ -29,6 +29,6 @@ probe ioblock.end { probe ioblock_trace.* { log(pp()) - printf("%s\t%p\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", - devname, q, sector, flags, rw, bio_rw_str(rw), vcnt, idx, phys_segments, size, bytes_done, error, ino) + printf("%s\t%d\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t%d\t%d\t%d\t%p\t%p\t%d\n", + devname, q, sector, flags, rw, bio_rw_str(rw), vcnt, idx, phys_segments, size, bytes_done, ino, p_start_sect, bdev_contains, bdev) } diff --git a/testsuite/buildok/ioscheduler.stp b/testsuite/buildok/ioscheduler.stp index 55ef9a0f..8b377619 100755 --- a/testsuite/buildok/ioscheduler.stp +++ b/testsuite/buildok/ioscheduler.stp @@ -16,7 +16,6 @@ probe ioscheduler_trace.elv* probe ioscheduler_trace.plug, ioscheduler_trace.unplug_io, ioscheduler_trace.unplug_timer { - printf("ppname: %s, request %p, elv_name: %s, %d, %d", probefunc(), - rq_queue) + printf("ppname: %s, request %p", probefunc(), rq_queue) } -- cgit From fad409cab6527b17dcc15a81505113606b8d4ed4 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 23 Nov 2009 16:38:04 +0800 Subject: Tweak cu-decl test * testsuite/systemtap.base/cu-decl.exp: Check utrace. * testsuite/lib/stap_compile.exp: Make catch after wait. --- testsuite/lib/stap_compile.exp | 2 +- testsuite/systemtap.base/cu-decl.exp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp index c8d44203..8780930e 100644 --- a/testsuite/lib/stap_compile.exp +++ b/testsuite/lib/stap_compile.exp @@ -19,8 +19,8 @@ proc stap_compile { TEST_NAME compile script args } { -re "compilation failed" {incr compile_errors 1; exp_continue} -re "semantic error:" {incr compile_errors 1; exp_continue} } - catch close set res [wait -i $spawn_id] + catch close set res [lindex $res 3] if {($res == 0 && $compile_errors == 0) diff --git a/testsuite/systemtap.base/cu-decl.exp b/testsuite/systemtap.base/cu-decl.exp index 42e683cb..ae06ad85 100644 --- a/testsuite/systemtap.base/cu-decl.exp +++ b/testsuite/systemtap.base/cu-decl.exp @@ -17,7 +17,9 @@ if { $res != "" } { } else { pass "$test target compilation" } - -stap_compile $test 1 "{$script}" - +if {![utrace_p]} { + untested "$test : no kernel utrace support found" +} else { + stap_compile $test 1 "{$script}" +} catch {exec rm $test} -- cgit From d58c711f40a92a0013cd62b6e96c4ae1c54fe045 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 23 Nov 2009 13:30:46 -0500 Subject: Correct tapset/ioscheduler.stp so documentation builds. --- tapset/ioscheduler.stp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tapset/ioscheduler.stp b/tapset/ioscheduler.stp index ac271f80..7f26cf23 100644 --- a/tapset/ioscheduler.stp +++ b/tapset/ioscheduler.stp @@ -145,7 +145,7 @@ probe ioscheduler.elv_completed_request } /** - * probe ioscheduler.elv_add_request.tp : tracepoint based probe to indicate a request is added to the request queue. + * probe ioscheduler.elv_add_request.tp - tracepoint based probe to indicate a request is added to the request queue. * @elevator_name : The type of I/O elevator currently enabled. * @q : Pointer to request queue. * @rq : Address of request. @@ -173,7 +173,7 @@ rq_flags = $rq==0? 0:$rq->cmd_flags } /** - * probe ioscheduler.elv_add_request : probe to indicate request is added to the request queue. + * probe ioscheduler.elv_add_request - probe to indicate request is added to the request queue. * @elevator_name : The type of I/O elevator currently enabled. * @q : Pointer to request queue. * @rq : Address of request. @@ -187,7 +187,7 @@ probe ioscheduler.elv_add_request = {} /** - * probe ioscheduler_trace.elv_completed_request : Fires when a request is + * probe ioscheduler_trace.elv_completed_request - Fires when a request is * completed. * @elevator_name : The type of I/O elevator currently enabled. * @rq : Address of request. @@ -214,7 +214,7 @@ rq_flags = $rq==0? 0:$rq->cmd_flags } /** - * probe ioscheduler_trace.elv_issue_request : Fires when a request is + * probe ioscheduler_trace.elv_issue_request - Fires when a request is * scheduled. * @elevator_name : The type of I/O elevator currently enabled. * @rq : Address of request. @@ -241,7 +241,7 @@ rq_flags = $rq==0? 0:$rq->cmd_flags } /** - * probe ioscheduler_trace.elv_requeue_request : Fires when a request is + * probe ioscheduler_trace.elv_requeue_request - Fires when a request is * put back on the queue, when the hadware cannot accept more requests. * @elevator_name : The type of I/O elevator currently enabled. * @rq : Address of request. @@ -268,7 +268,7 @@ rq_flags = $rq==0? 0:$rq->cmd_flags } /** - * probe ioscheduler_trace.elv_abort_request : Fires when a request is aborted. + * probe ioscheduler_trace.elv_abort_request - Fires when a request is aborted. * @elevator_name : The type of I/O elevator currently enabled. * @rq : Address of request. * @rq_flags : Request flags. -- cgit From 18871ad0ed1c0618dc4c2479eadbcf982b72e6cd Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 23 Nov 2009 14:13:38 -0600 Subject: Fixed tapset reference manual generation. * doc/SystemTap_Tapset_Reference/Makefile.am: Check for file existence before doing compare. * doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated. * tapset/ioblock.stp: Fixed comment so that docs can be built. --- doc/SystemTap_Tapset_Reference/Makefile.am | 2 +- doc/SystemTap_Tapset_Reference/Makefile.in | 2 +- tapset/ioblock.stp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/SystemTap_Tapset_Reference/Makefile.am b/doc/SystemTap_Tapset_Reference/Makefile.am index 454b3331..109aaa9e 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.am +++ b/doc/SystemTap_Tapset_Reference/Makefile.am @@ -30,7 +30,7 @@ if BUILD_REFDOCS all: $(PDFDOCS) stamp-htmldocs stamp-mandocs tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp') SRCTREE=$(SRCTREE) $(DOCPROC) doc $(abs_srcdir)/tapsets.tmpl > tapsets.xml.new - if cmp tapsets.xml.new tapsets.xml >/dev/null ; then \ + if test -s tapsets.xml && cmp tapsets.xml.new tapsets.xml >/dev/null ; then \ echo tapsets.xml unchanged; \ rm tapsets.xml.new; \ else \ diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in index 5059b159..158c9b6b 100644 --- a/doc/SystemTap_Tapset_Reference/Makefile.in +++ b/doc/SystemTap_Tapset_Reference/Makefile.in @@ -470,7 +470,7 @@ uninstall-am: @BUILD_REFDOCS_TRUE@all: $(PDFDOCS) stamp-htmldocs stamp-mandocs @BUILD_REFDOCS_TRUE@tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp') @BUILD_REFDOCS_TRUE@ SRCTREE=$(SRCTREE) $(DOCPROC) doc $(abs_srcdir)/tapsets.tmpl > tapsets.xml.new -@BUILD_REFDOCS_TRUE@ if cmp tapsets.xml.new tapsets.xml >/dev/null ; then \ +@BUILD_REFDOCS_TRUE@ if test -s tapsets.xml && cmp tapsets.xml.new tapsets.xml >/dev/null ; then \ @BUILD_REFDOCS_TRUE@ echo tapsets.xml unchanged; \ @BUILD_REFDOCS_TRUE@ rm tapsets.xml.new; \ @BUILD_REFDOCS_TRUE@ else \ diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp index 707fad4c..761e7df7 100644 --- a/tapset/ioblock.stp +++ b/tapset/ioblock.stp @@ -280,7 +280,7 @@ probe ioblock_trace.request = kernel.trace("block_bio_queue") * BIO_BOUNCED 5 bio is a bounce bio * BIO_USER_MAPPED 6 contains user pages * BIO_EOPNOTSUPP 7 not supported - + * * @rw - binary trace for read/write request * @vcnt - bio vector count which represents number of array element (page, offset, length) which makes up this I/O request * @idx - offset into the bio vector array -- cgit From 90bba7158de040705a101ba1fdf6062866b4b4e9 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 23 Nov 2009 14:15:20 -0600 Subject: Updated. --- .gitignore | 1 + initscript/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5869f401..e10d5226 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ build-elfutils include-elfutils lib-elfutils stamp-elfutils +dtrace diff --git a/initscript/.gitignore b/initscript/.gitignore index ec0530ab..37416cbb 100644 --- a/initscript/.gitignore +++ b/initscript/.gitignore @@ -1 +1,2 @@ systemtap +stap-server -- cgit