From 033efc2dd4a443cef1d720246aded27dc695ea1b Mon Sep 17 00:00:00 2001 From: Brendan Gregg Date: Thu, 24 Jul 2014 16:00:14 -0700 Subject: [PATCH] trap HUP --- disk/bitesize | 2 +- execsnoop | 1 + iolatency | 2 +- iosnoop | 2 +- kernel/funccount | 2 +- kernel/functrace | 2 +- kernel/kprobe | 2 +- misc/perf-stat-hist | 2 +- opensnoop | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/disk/bitesize b/disk/bitesize index 9ee052c..f2de40a 100755 --- a/disk/bitesize +++ b/disk/bitesize @@ -46,7 +46,7 @@ duration=0 buckets=(1 8 64 128) secsz=512 -trap ':' INT QUIT TERM PIPE +trap ':' INT QUIT TERM PIPE HUP function usage { cat <<-END >&2 diff --git a/execsnoop b/execsnoop index 0ac8e22..ee975fa 100755 --- a/execsnoop +++ b/execsnoop @@ -61,6 +61,7 @@ local $SIG{INT} = \&cleanup; local $SIG{QUIT} = \&cleanup; local $SIG{TERM} = \&cleanup; local $SIG{PIPE} = \&cleanup; +local $SIG{HUP} = \&cleanup; $| = 1; ### options diff --git a/iolatency b/iolatency index 2e0ddec..d646193 100755 --- a/iolatency +++ b/iolatency @@ -45,7 +45,7 @@ flock=/var/tmp/.ftrace-lock bufsize_kb=4096 opt_device=0; device=; opt_iotype=0; iotype=; opt_timestamp=0 opt_interval=0; interval=1; opt_count=0; count=0; opt_queue=0 -trap ':' INT QUIT TERM PIPE # sends execution to end tracing section +trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2 diff --git a/iosnoop b/iosnoop index 307264e..c5de4e3 100755 --- a/iosnoop +++ b/iosnoop @@ -59,7 +59,7 @@ bufsize_kb=4096 opt_duration=0; duration=; opt_name=0; name=; opt_pid=0; pid=; ftext= opt_start=0; opt_end=0; opt_device=0; device=; opt_iotype=0; iotype= opt_queue=0 -trap ':' INT QUIT TERM PIPE # sends execution to end tracing section +trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2 diff --git a/kernel/funccount b/kernel/funccount index 87496dd..b10512d 100755 --- a/kernel/funccount +++ b/kernel/funccount @@ -43,7 +43,7 @@ tracing=/sys/kernel/debug/tracing opt_duration=0; duration=; opt_interval=0; interval=999999; opt_timestamp=0 opt_tail=0; tcmd=cat; ttext= -trap 'quit=1' INT QUIT TERM PIPE # sends execution to end tracing section +trap 'quit=1' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2 diff --git a/kernel/functrace b/kernel/functrace index 8b17d70..0f89f09 100755 --- a/kernel/functrace +++ b/kernel/functrace @@ -60,7 +60,7 @@ tracing=/sys/kernel/debug/tracing flock=/var/tmp/.ftrace-lock opt_duration=0; duration=; opt_pid=0; pid=; pidtext=; opt_headers=0 -trap ':' INT QUIT TERM PIPE # sends execution to end tracing section +trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2 diff --git a/kernel/kprobe b/kernel/kprobe index 5b25cfe..695ffa4 100755 --- a/kernel/kprobe +++ b/kernel/kprobe @@ -46,7 +46,7 @@ tracing=/sys/kernel/debug/tracing flock=/var/tmp/.ftrace-lock; wroteflock=0 opt_duration=0; duration=; opt_pid=0; pid=; opt_filter=0; filter= opt_view=0; opt_headers=0; dmesg=2 -trap ':' INT QUIT TERM PIPE # sends execution to end tracing section +trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2 diff --git a/misc/perf-stat-hist b/misc/perf-stat-hist index 1c637f7..503b5fe 100755 --- a/misc/perf-stat-hist +++ b/misc/perf-stat-hist @@ -44,7 +44,7 @@ opt_buckets=0; buckets=; opt_power=0; power=4; opt_max=0; max=$((1024 * 1024)) duration=0; debug=0 -trap ':' INT QUIT TERM PIPE +trap ':' INT QUIT TERM PIPE HUP function usage { cat <<-END >&2 diff --git a/opensnoop b/opensnoop index 3d3ddcd..603f23e 100755 --- a/opensnoop +++ b/opensnoop @@ -50,7 +50,7 @@ tracing=/sys/kernel/debug/tracing flock=/var/tmp/.ftrace-lock; wroteflock=0 opt_duration=0; duration=; opt_name=0; name=; opt_pid=0; pid=; ftext= opt_time=0; opt_fail=0; opt_file=0; file= -trap ':' INT QUIT TERM PIPE # sends execution to end tracing section +trap ':' INT QUIT TERM PIPE HUP # sends execution to end tracing section function usage { cat <<-END >&2