mirror of
https://github.com/brendangregg/perf-tools.git
synced 2025-11-30 23:16:03 +07:00
syscount: Fix for perf list and perf script.
perf list adds the header 'List of ..' which requires to be filtered, otherwise follow up commands fail. perf script has had its option for fields changed from '-f' to '-F' in recent perf. Hence, using longer option for compatibility.
This commit is contained in:
10
syscount
10
syscount
@@ -142,7 +142,7 @@ if (( opt_count && opt_verbose )); then
|
|||||||
if (( write_workaround )); then
|
if (( write_workaround )); then
|
||||||
# this list must end in write to associate the filter
|
# this list must end in write to associate the filter
|
||||||
tp=$(perf list syscalls:sys_enter_* | awk '
|
tp=$(perf list syscalls:sys_enter_* | awk '
|
||||||
$1 != "syscalls:sys_enter_write" { printf "-e %s ", $1 }')
|
$1 != "syscalls:sys_enter_write" && $1 ~ /syscalls:/ { printf "-e %s ", $1 }')
|
||||||
tp="$tp -e syscalls:sys_enter_write"
|
tp="$tp -e syscalls:sys_enter_write"
|
||||||
sh -c "perf record $tp --filter 'common_pid != '\$\$ $cpus $cmd"
|
sh -c "perf record $tp --filter 'common_pid != '\$\$ $cpus $cmd"
|
||||||
else
|
else
|
||||||
@@ -151,8 +151,8 @@ if (( opt_count && opt_verbose )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%-6s %-16s %-17s %8s\n" "PID" "COMM" "SYSCALL" "COUNT"
|
printf "%-6s %-16s %-17s %8s\n" "PID" "COMM" "SYSCALL" "COUNT"
|
||||||
perf script -f pid,comm,event | awk '$1 != "#" {
|
perf script --fields pid,comm,event | awk '$1 != "#" {
|
||||||
sub("sys_enter_", ""); sub(":", "")
|
sub("syscalls:sys_enter_", ""); sub(":", "")
|
||||||
a[$1 ";" $2 ";" $3]++
|
a[$1 ";" $2 ";" $3]++
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
@@ -174,7 +174,7 @@ fi
|
|||||||
|
|
||||||
if (( opt_verbose )); then
|
if (( opt_verbose )); then
|
||||||
printf "%-6s %-16s %8s\n" "PID" "COMM" "COUNT"
|
printf "%-6s %-16s %8s\n" "PID" "COMM" "COUNT"
|
||||||
perf script -f pid,comm | awk '$1 != "#" { a[$1 ";" $2]++ }
|
perf script --fields pid,comm | awk '$1 != "#" { a[$1 ";" $2]++ }
|
||||||
END {
|
END {
|
||||||
for (k in a) {
|
for (k in a) {
|
||||||
split(k, b, ";");
|
split(k, b, ";");
|
||||||
@@ -183,7 +183,7 @@ if (( opt_verbose )); then
|
|||||||
}' | sort -n -k3 | $tcmd
|
}' | sort -n -k3 | $tcmd
|
||||||
else
|
else
|
||||||
printf "%-16s %8s\n" "COMM" "COUNT"
|
printf "%-16s %8s\n" "COMM" "COUNT"
|
||||||
perf script -f comm | awk '$1 != "#" { a[$1]++ }
|
perf script --fields comm | awk '$1 != "#" { a[$1]++ }
|
||||||
END {
|
END {
|
||||||
for (k in a) {
|
for (k in a) {
|
||||||
printf "%-16s %8d\n", k, a[k]
|
printf "%-16s %8d\n", k, a[k]
|
||||||
|
|||||||
Reference in New Issue
Block a user