diff options
-rw-r--r-- | dwflpp.cxx | 63 | ||||
-rw-r--r-- | dwflpp.h | 14 | ||||
-rw-r--r-- | loc2c-test.c | 4 | ||||
-rw-r--r-- | stapprobes.3stap.in | 5 | ||||
-rw-r--r-- | tapsets.cxx | 16 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.html | 6 | ||||
-rw-r--r-- | testsuite/systemtap.examples/index.txt | 27 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.html | 6 | ||||
-rw-r--r-- | testsuite/systemtap.examples/keyword-index.txt | 27 | ||||
-rw-r--r-- | testsuite/systemtap.examples/locks/bkl.meta | 10 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/locks/bkl.stp | 54 | ||||
-rw-r--r-- | testsuite/systemtap.examples/locks/bkl_stats.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/locks/bkl_stats.stp | 85 | ||||
-rw-r--r-- | testsuite/systemtap.exelib/exelib.exp | 27 | ||||
-rw-r--r-- | testsuite/systemtap.exelib/ustack.tcl | 3 |
15 files changed, 327 insertions, 33 deletions
@@ -174,6 +174,10 @@ dwflpp::focus_on_function(Dwarf_Die * f) } +/* Return the Dwarf_Die for the given address in the current module. + * The address should be in the module address address space (this + * function will take care of any dw bias). + */ Dwarf_Die * dwflpp::query_cu_containing_address(Dwarf_Addr a) { @@ -182,10 +186,6 @@ dwflpp::query_cu_containing_address(Dwarf_Addr a) assert(module); get_module_dwarf(); - // globalize the module-relative address - if (module_name != TOK_KERNEL && dwfl_module_relocations (module) > 0) - a += module_start; - Dwarf_Die* cudie = dwfl_module_addrdie(module, a, &bias); assert(bias == module_bias); return cudie; @@ -193,7 +193,7 @@ dwflpp::query_cu_containing_address(Dwarf_Addr a) bool -dwflpp::module_name_matches(string pattern) +dwflpp::module_name_matches(const string& pattern) { bool t = (fnmatch(pattern.c_str(), module_name.c_str(), 0) == 0); if (t && sess.verbose>3) @@ -205,7 +205,7 @@ dwflpp::module_name_matches(string pattern) bool -dwflpp::name_has_wildcard(string pattern) +dwflpp::name_has_wildcard(const string& pattern) { return (pattern.find('*') != string::npos || pattern.find('?') != string::npos || @@ -214,7 +214,7 @@ dwflpp::name_has_wildcard(string pattern) bool -dwflpp::module_name_final_match(string pattern) +dwflpp::module_name_final_match(const string& pattern) { // Assume module_name_matches(). Can there be any more matches? // Not unless the pattern is a wildcard, since module names are @@ -224,7 +224,7 @@ dwflpp::module_name_final_match(string pattern) bool -dwflpp::function_name_matches_pattern(string name, string pattern) +dwflpp::function_name_matches_pattern(const string& name, const string& pattern) { bool t = (fnmatch(pattern.c_str(), name.c_str(), 0) == 0); if (t && sess.verbose>3) @@ -236,7 +236,7 @@ dwflpp::function_name_matches_pattern(string name, string pattern) bool -dwflpp::function_name_matches(string pattern) +dwflpp::function_name_matches(const string& pattern) { assert(function); return function_name_matches_pattern(function_name, pattern); @@ -244,7 +244,7 @@ dwflpp::function_name_matches(string pattern) bool -dwflpp::function_name_final_match(string pattern) +dwflpp::function_name_final_match(const string& pattern) { return module_name_final_match (pattern); } @@ -565,26 +565,26 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * clog << "function cache " << key << " size " << v->size() << endl; } - string subkey = function; - if (v->find(subkey) != v->end()) + cu_function_cache_t::iterator it = v->find(function); + if (it != v->end()) { - Dwarf_Die die = v->find(subkey)->second; + Dwarf_Die die = it->second; if (sess.verbose > 4) - clog << "function cache " << key << " hit " << subkey << endl; + clog << "function cache " << key << " hit " << function << endl; return (*callback)(& die, q); } - else if (name_has_wildcard (subkey)) + else if (name_has_wildcard (function)) { - for (cu_function_cache_t::iterator it = v->begin(); it != v->end(); it++) + for (it = v->begin(); it != v->end(); it++) { if (pending_interrupts) return DWARF_CB_ABORT; string func_name = it->first; Dwarf_Die die = it->second; - if (function_name_matches_pattern (func_name, subkey)) + if (function_name_matches_pattern (func_name, function)) { if (sess.verbose > 4) clog << "function cache " << key << " match " << func_name << " vs " - << subkey << endl; + << function << endl; rc = (*callback)(& die, q); if (rc != DWARF_CB_OK) break; @@ -2378,6 +2378,33 @@ dwflpp::relocate_address(Dwarf_Addr dw_addr, return reloc_addr; } +/* Converts a "global" literal address to the module symbol address + * space. If necessary (not for kernel and executables using absolute + * addresses), this adjust the address for the current module symbol + * bias. Literal addresses are provided by the user (or contained on + * the .probes section) based on the "on disk" layout of the module. + */ +Dwarf_Addr +dwflpp::literal_addr_to_sym_addr(Dwarf_Addr lit_addr) +{ + // Assume the address came from the symbol list. + // If we cannot get the symbol bias fall back on the dw bias. + // The kernel (and other absolute executable modules) is special though. + if (module_name != TOK_KERNEL + && dwfl_module_relocations (module) > 0) + { + Dwarf_Addr symbias = ~0; + if (dwfl_module_getsymtab (module) != -1) + dwfl_module_info (module, NULL, NULL, NULL, NULL, + &symbias, NULL, NULL); + if (symbias == (Dwarf_Addr) ~0) + symbias = module_bias; + + lit_addr += symbias; + } + + return lit_addr; +} int dwflpp::dwarf_getscopes_cached (Dwarf_Addr pc, Dwarf_Die **scopes) @@ -198,13 +198,13 @@ struct dwflpp Dwarf_Die *query_cu_containing_address(Dwarf_Addr a); - bool module_name_matches(std::string pattern); - bool name_has_wildcard(std::string pattern); - bool module_name_final_match(std::string pattern); + bool module_name_matches(const std::string& pattern); + bool name_has_wildcard(const std::string& pattern); + bool module_name_final_match(const std::string& pattern); - bool function_name_matches_pattern(std::string name, std::string pattern); - bool function_name_matches(std::string pattern); - bool function_name_final_match(std::string pattern); + bool function_name_matches_pattern(const std::string& name, const std::string& pattern); + bool function_name_matches(const std::string& pattern); + bool function_name_final_match(const std::string& pattern); void iterate_over_modules(int (* callback)(Dwfl_Module *, void **, const char *, Dwarf_Addr, @@ -291,6 +291,8 @@ struct dwflpp std::string& reloc_section, std::string& blacklist_section); + Dwarf_Addr literal_addr_to_sym_addr(Dwarf_Addr lit_addr); + private: Dwfl * dwfl; diff --git a/loc2c-test.c b/loc2c-test.c index a584c024..01edc805 100644 --- a/loc2c-test.c +++ b/loc2c-test.c @@ -255,7 +255,9 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out, if (typedie == NULL) error (2, 0, _("cannot get type of field: %s"), dwarf_errmsg (-1)); typetag = dwarf_tag (typedie); - if (typetag != DW_TAG_typedef) + if (typetag != DW_TAG_typedef && + typetag != DW_TAG_const_type && + typetag != DW_TAG_volatile_type) break; if (dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem) == NULL) error (2, 0, _("cannot get type of field: %s"), dwarf_errmsg (-1)); diff --git a/stapprobes.3stap.in b/stapprobes.3stap.in index 795a9a92..2cb206c5 100644 --- a/stapprobes.3stap.in +++ b/stapprobes.3stap.in @@ -536,7 +536,10 @@ to the working directory if they contain a "/" character, otherwise in If a process probe is specified without a PID or PATH, all user threads are probed. PATH may sometimes name a shared library in which case all processes that map that shared library may be -probed. +probed. However, if systemtap was invoked with the +.IR -c " or " -x +options, then process probes are restricted to the process +hierarchy associated with the target process. .SS PROCFS diff --git a/tapsets.cxx b/tapsets.cxx index 0a07e7a8..39255f50 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -989,8 +989,9 @@ dwarf_query::query_module_dwarf() else addr = statement_num_val; - // NB: we don't need to add the module base address or bias - // value here (for reasons that may be coincidental). + // Translate to an actual symbol address. + addr = dw.literal_addr_to_sym_addr (addr); + Dwarf_Die* cudie = dw.query_cu_containing_address(addr); if (cudie) // address could be wildly out of range query_cu(cudie, this); @@ -1549,6 +1550,11 @@ query_dwarf_func (Dwarf_Die * func, base_query * bq) Dwarf_Die d; q->dw.function_die (&d); + // Translate literal address to symbol address, then + // compensate for dw bias. + query_addr = q->dw.literal_addr_to_sym_addr(query_addr); + query_addr -= q->dw.module_bias; + if (q->dw.die_has_pc (d, query_addr)) record_this_function = true; } @@ -1579,6 +1585,12 @@ query_dwarf_func (Dwarf_Die * func, base_query * bq) else if (q->has_statement_num) { func.entrypc = q->statement_num_val; + + // Translate literal address to symbol address, then + // compensate for dw bias (will be used for query dw funcs). + func.entrypc = q->dw.literal_addr_to_sym_addr(func.entrypc); + func.entrypc -= q->dw.module_bias; + q->filtered_functions.push_back (func); if (q->dw.function_name_final_match (q->function)) return DWARF_CB_ABORT; diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index c485713c..5435829f 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -85,6 +85,12 @@ keywords: <a href="keyword-index.html#IO">IO</a> <br> <li><a href="io/ttyspy.stp">io/ttyspy.stp</a> - Monitor tty typing.<br> keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#TTY">TTY</a> <a href="keyword-index.html#PER-PROCESS">PER-PROCESS</a> <a href="keyword-index.html#MONITOR">MONITOR</a> <br> <p>The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis.</p></li> +<li><a href="locks/bkl.stp">locks/bkl.stp</a> - Tracing Contention on Big Kernel Lock (BKL)<br> +keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br> +<p>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.</p></li> +<li><a href="locks/bkl_stats.stp">locks/bkl_stats.stp</a> - Per Process Statistics on Big Kernel Lock (BKL) Use<br> +keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br> +<p>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.</p></li> <li><a href="memory/kmalloc-top">memory/kmalloc-top</a> - Show Paths to Kernel Malloc (kmalloc) Invocations<br> keywords: <a href="keyword-index.html#MEMORY">MEMORY</a> <br> <p>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).</p></li> diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt index caf1a5ff..53270b01 100644 --- a/testsuite/systemtap.examples/index.txt +++ b/testsuite/systemtap.examples/index.txt @@ -137,6 +137,33 @@ keywords: io tty per-process monitor keystrokes, on a per-tty basis. +locks/bkl.stp - Tracing Contention on Big Kernel Lock (BKL) +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. + + memory/kmalloc-top - Show Paths to Kernel Malloc (kmalloc) Invocations keywords: memory diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index 9852c992..f3db1429 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -153,6 +153,12 @@ keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#SCH </ul> <h3><a name="LOCKING">LOCKING</a></h3> <ul> +<li><a href="locks/bkl.stp">locks/bkl.stp</a> - Tracing Contention on Big Kernel Lock (BKL)<br> +keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br> +<p>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.</p></li> +<li><a href="locks/bkl_stats.stp">locks/bkl_stats.stp</a> - Per Process Statistics on Big Kernel Lock (BKL) Use<br> +keywords: <a href="keyword-index.html#LOCKING">LOCKING</a> <br> +<p>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.</p></li> <li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br> keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#LOCKING">LOCKING</a> <a href="keyword-index.html#FUTEX">FUTEX</a> <br> <p>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.</p></li> diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt index 4778afc7..d3d66fe2 100644 --- a/testsuite/systemtap.examples/keyword-index.txt +++ b/testsuite/systemtap.examples/keyword-index.txt @@ -250,6 +250,33 @@ keywords: io scheduler backtrace = LOCKING = +locks/bkl.stp - Tracing Contention on Big Kernel Lock (BKL) +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. + + process/futexes.stp - System-Wide Futex Contention keywords: syscall locking futex diff --git a/testsuite/systemtap.examples/locks/bkl.meta b/testsuite/systemtap.examples/locks/bkl.meta new file mode 100644 index 00000000..e4afabde --- /dev/null +++ b/testsuite/systemtap.examples/locks/bkl.meta @@ -0,0 +1,10 @@ +title: Tracing Contention on Big Kernel Lock (BKL) +name: bkl.stp +keywords: locking +subsystem: kernel +author: Flavio Leitner +status: production +exit: user-controlled +description: 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. +test_check: stap -p4 bkl.stp 1 +test_installcheck: stap bkl.stp -c "sleep 1" 1 diff --git a/testsuite/systemtap.examples/locks/bkl.stp b/testsuite/systemtap.examples/locks/bkl.stp new file mode 100755 index 00000000..5dd26e18 --- /dev/null +++ b/testsuite/systemtap.examples/locks/bkl.stp @@ -0,0 +1,54 @@ +#! /usr/bin/env stap + +/* + * Copyright (C) 2009 Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions + * of the GNU General Public License v.2. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * Description: displays which task is holding big kernel lock (BKL) when the + * number of waiting processes reaches a certain number. + * + * Run: stap bkl.stp <number_of_processes_waiting> + * + * Author: Flavio Leitner <fbl@redhat.com> + */ + +# how many tasks waiting on big lock +global waiting = 0 +# who is holding big lock +global holder = 0 +global holder_time + +probe begin { printf("stap ready\n"); } + +probe end { printf("stap exiting\n"); } + +probe kernel.function("lock_kernel") { + ++waiting; +} + +probe kernel.function("lock_kernel").return { + # under biglock + holder_time = gettimeofday_us(); + holder = task_current(); + --waiting; +} + +probe kernel.function("unlock_kernel") { + # under biglock + if (waiting >= $1) { + printf("%-25s: waiting(%d), holder: %s(%d) %dus\n", + ctime(gettimeofday_s()), + waiting, + task_execname(holder), + task_pid(holder), + gettimeofday_us() - holder_time); + } +} diff --git a/testsuite/systemtap.examples/locks/bkl_stats.meta b/testsuite/systemtap.examples/locks/bkl_stats.meta new file mode 100644 index 00000000..00d55c68 --- /dev/null +++ b/testsuite/systemtap.examples/locks/bkl_stats.meta @@ -0,0 +1,13 @@ +title: Per Process Statistics on Big Kernel Lock (BKL) Use +name: bkl_stats.stp +version: 1.0 +author: William Cohen +keywords: locking +subsystem: kernel +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. +test_check: stap -p4 bkl_stats.stp +test_installcheck: stap bkl_stats.stp -c "sleep 1" diff --git a/testsuite/systemtap.examples/locks/bkl_stats.stp b/testsuite/systemtap.examples/locks/bkl_stats.stp new file mode 100755 index 00000000..4481e493 --- /dev/null +++ b/testsuite/systemtap.examples/locks/bkl_stats.stp @@ -0,0 +1,85 @@ +#! /usr/bin/env stap + +/* + * Copyright (C) 2009 Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions + * of the GNU General Public License v.2. + * + * You should have received a copy of the GNU General Public License + * 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) + * + * Run: stap bkl_stats.stap + * + * Author: William Cohen <wcohen@redhat.com> + */ + +global holder_time, wait_time +global holder_stats, wait_stats +global names + +probe begin { printf("biglock_stats running\n"); } + +probe end, timer.s(5) { + print_stats() +} + +function print_stats() { + # print out time waiting and time lock held + printf("big kernel lock waiting statistics\n"); + printf("%-16s %6s %6s %6s %6s %6s\n", + "name", "tid", "count", "min", "avg", "max"); + foreach (p+ in names) { + if (@count(wait_stats[p])) + printf("%16s %6d %6d %6d %6d %6d\n", names[p], p, + @count(wait_stats[p]), @min(wait_stats[p]), + @avg(wait_stats[p]), @max(wait_stats[p])); + } + + printf("\n\nbig kernel lock holder statistics\n"); + printf("%-16s %6s %6s %6s %6s %6s\n", + "name", "tid", "count", "min", "avg", "max"); + foreach (p+ in names) { + if (@count(holder_stats[p])) + printf("%16s %6d %6d %6d %6d %6d\n", names[p], p, + @count(holder_stats[p]), @min(holder_stats[p]), + @avg(holder_stats[p]), @max(holder_stats[p])); + } +} + +probe kernel.function("lock_kernel") { + t = gettimeofday_us() + wait_time[tid()] = t +} + +probe kernel.function("lock_kernel").return { + t = gettimeofday_us() + s = wait_time[tid()] + holder_time[tid()] = t + # record the amount of time waiting for the lock + if (s) { + wait_stats[tid()] <<< t - s + names[tid()] = execname() + } +} + +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 + if (s) { + holder_stats[tid()] <<< t - s + names[tid()] = execname() + } +} diff --git a/testsuite/systemtap.exelib/exelib.exp b/testsuite/systemtap.exelib/exelib.exp index 960ebbfa..d3ade2b6 100644 --- a/testsuite/systemtap.exelib/exelib.exp +++ b/testsuite/systemtap.exelib/exelib.exp @@ -31,7 +31,7 @@ set testsrclib "$testpath/uprobes_lib.c" set testlibdir "." set arches [list "default"] -# BUG! non-default arch breaks ustack tests. +# BUG! non-default arch breaks mark and ustack tests PR10318 and PR10272 #switch -regexp $::tcl_platform(machine) { # {^(x86_64|ppc64)$} { lappend arches "-m32" } # {^s390x$} { lappend arches "-m31" } @@ -39,25 +39,37 @@ set arches [list "default"] foreach arch $arches { - foreach compiler {gcc g++} { + # Compiling with plain gcc. g++ is also supported but disabled + # because it didn't add much interesting differences in binaries + # and exploded the test search case a bit. + foreach compiler {gcc} { # Add g++ # Just try -O0 and -O3. # Adding -O, -O2, -Os and mixing lib/exe is a bit overdone foreach opt {-O0 -O3} { - foreach libprelink {no} { # BUG! "yes" breaks uname tests + foreach libprelink {no yes} { # BUG! "yes" breaks ustack PR10323 # not done yet, "no" lib debug. - foreach libdebug {yes sep} { + # seperate debuginfo can be done before or after prelinking + # (after is only done if prelinking is also done + foreach libdebug {yes sep sep-after} { set libname "uprobeslib${compiler}${opt}${arch}" if {$libprelink == "yes"} { set libname $libname-prelink } + + # This combination doesn't make sense + if {$libdebug == "sep-after" && $libprelink == "no"} { + continue; + } if {$libdebug == "sep"} { set libname $libname-sep-debug + } elseif {$libdebug == "sep-after"} { + set libname $libname-sep-debug-after } else { set libname $libname-debug } @@ -89,7 +101,7 @@ foreach arch $arches { pass "$libname compile $testsrclib" } - + # seperate debuginfo before prelinking if {$libdebug == "sep"} { seperate_debuginfo $testso } @@ -103,6 +115,11 @@ foreach arch $arches { verbose -log "result is $result" } + # seperate debuginfo after prelinking + if {$libdebug == "sep-after"} { + seperate_debuginfo $testso + } + # should we also prelink exes? foreach exepie {no yes} { # not supported, "no" exe debug. diff --git a/testsuite/systemtap.exelib/ustack.tcl b/testsuite/systemtap.exelib/ustack.tcl index b70b8334..07dcec10 100644 --- a/testsuite/systemtap.exelib/ustack.tcl +++ b/testsuite/systemtap.exelib/ustack.tcl @@ -7,6 +7,9 @@ lib: lib_func=lib_func lib: lib_func=lib_func lib: lib_func=lib_func} +# BUG XXX PR10323 skip all prelink scenarios for now. +if {[string match "*prelink*" "$testname"]} { return } + # Only run on make installcheck if {! [installtest_p]} { untested "ustack-$testname"; return } if {! [utrace_p]} { untested "ustack-$testname"; return } |