-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add a test case for signal trigger
$ uftrace -a --signal SIGUSR1@finish tests/t-signal # DURATION TID FUNCTION [ 13635] | main(1, 0x7ffd5c074428) { 0.245 us [ 13635] | foo() = 0; 1.572 us [ 13635] | signal(SIGUSR1, &sighandler) = 0x7f20827b9fd0; [ 13635] | raise() { [ 13635] | sighandler(10) { 0.102 us [ 13635] | bar(10); [ 13635] | /* linux:task-exit */ 4.376 us [ 13635] | } /* sighandler */ uftrace stopped tracing with remaining functions ================================================ task: 13635 [2] sighandler [1] raise [0] main Signed-off-by: Namhyung Kim <namhyung@gmail.com>
- Loading branch information
Showing
4 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
from runtest import TestBase | ||
|
||
class TestCase(TestBase): | ||
def __init__(self): | ||
TestBase.__init__(self, 'signal', """ | ||
# DURATION TID FUNCTION | ||
[ 11892] | main() { | ||
0.241 us [ 11892] | foo(); | ||
1.611 us [ 11892] | signal(); | ||
[ 11892] | raise() { | ||
[ 11892] | sighandler() { | ||
0.120 us [ 11892] | bar(); | ||
2.315 us [ 11892] | } /* sighandler */ | ||
uftrace stopped tracing with remaining functions | ||
================================================ | ||
task: 11892 | ||
[2] sighandler | ||
[1] raise | ||
[0] main | ||
""") | ||
|
||
def runcmd(self): | ||
uftrace = TestBase.uftrace_cmd | ||
options = "--signal SIGUSR1@finish" | ||
program = 't-' + self.name | ||
|
||
return "%s %s %s" % (uftrace, options, program) | ||
|
||
def fixup(self, cflags, result): | ||
return result.replace(""" } /* sighandler */ | ||
""", "") |