summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-21 20:43:51 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:24 +0900
commit9591aa33a3fe92819a637d5d3dcca30b302b5eb6 (patch)
treea6b01f4fb943b8567d771a802404753c301ec532 /testsuite
parent829610cc7f35545c44e8f6ad71ffc1e6730883ad (diff)
downloadltrace-9591aa33a3fe92819a637d5d3dcca30b302b5eb6.tar.gz
ltrace-9591aa33a3fe92819a637d5d3dcca30b302b5eb6.tar.bz2
ltrace-9591aa33a3fe92819a637d5d3dcca30b302b5eb6.zip
Consider exec and exit events an end of outstanding calls
- This cleans up a lot of stuff. The actual substance is addition of account_current_callstack in handle_event.c (which however uses those cleaned-up interfaces). - trace-exec.exp was extended to check that the exec syscall can be seen in -c output. That's one of the symptoms of what this fixes. - This hides dict_opt_c in summary.c. It also gets rid of the global variable current_time_spent--instead, the information is passed via a function argument in a struct timedelta (so that we never confuse absolute time with relative). callstack_element.time_spent was renamed to .enter_time, as that is what it has always been.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ltrace.minor/trace-exec.exp16
1 files changed, 12 insertions, 4 deletions
diff --git a/testsuite/ltrace.minor/trace-exec.exp b/testsuite/ltrace.minor/trace-exec.exp
index 7a953de..57260f8 100644
--- a/testsuite/ltrace.minor/trace-exec.exp
+++ b/testsuite/ltrace.minor/trace-exec.exp
@@ -1,5 +1,5 @@
# This file is part of ltrace.
-# Copyright (C) 2012 Petr Machata, Red Hat Inc.
+# Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -16,22 +16,30 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
-ltraceMatch [ltraceRun -xmain -- [ltraceCompile {} [ltraceSource c {
+set bin1 [ltraceCompile {} [ltraceSource c {
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
execl(argv[1], argv[1], NULL);
abort();
}
-}]] [ltraceCompile {} [ltraceSource c {
+}]]
+
+set bin2 [ltraceCompile {} [ltraceSource c {
#include <stdio.h>
int main(void) {
return puts("Hello, World.");
}
-}]]] {
+}]]
+
+ltraceMatch [ltraceRun -xmain -- $bin1 $bin2] {
{{^execl\(} == 1}
{{^puts\(.*\) .*= 14} == 1}
{{^main\(} == 2}
}
+ltraceMatch [ltraceRun -c -- $bin1 $bin2] {
+ {{exec} > 0}
+}
+
ltraceDone