Skip to contentSkip to conversation

perf test: Record only user callchains

PATCH In review Michael Petlan 4 participants 8 messages Jun 14, 2022 – Jun 15, 2022 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Record only user callchains

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main

Adding '--user-callchains' leaves only the wanted symbols in the chain.

---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
Signature · 1 line
2.18.4
Reviewed-by on v1 1/1
#1 lore raw

Hi Michael, thanks for the fix

Quoted 8 lines · Michael Petlan

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

I think you meant "kernel callchains"

Quoted 9 lines
	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main
Quoted 5 lines

Adding '--user-callchains' leaves only the wanted symbols in the chain.

Fixes cd6382d82752 ("perf test arm64: Test unwinding using fame-pointer (fp) mode")

German

Quoted 17 lines
---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
#2 lore raw
Quoted 6 lines · German Gomez

Hi Michael, thanks for the fix

Quoted 3 lines · Michael Petlan

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

Quoted 7 lines
Quoted 5 lines
    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

I think you meant "kernel callchains"

Oh... of course I did. Thanks.

Quoted 40 lines
Quoted 10 lines
	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main
Quoted 5 lines

Adding '--user-callchains' leaves only the wanted symbols in the chain.

Fixes cd6382d82752 ("perf test arm64: Test unwinding using fame-pointer (fp) mode")

German

Quoted 17 lines
---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
#3 lore raw
In reply to German Gomez

Em Tue, Jun 14, 2022 at 01:11:20PM +0100, German Gomez escreveu:

Quoted 6 lines

Hi Michael, thanks for the fix

Quoted 3 lines · Michael Petlan

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

Quoted 7 lines
Quoted 5 lines
    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

I think you meant "kernel callchains"

Fixed

Quoted 9 lines
Quoted 9 lines
	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main
Quoted 8 lines
Quoted 5 lines

Adding '--user-callchains' leaves only the wanted symbols in the chain.

Fixes cd6382d82752 ("perf test arm64: Test unwinding using fame-pointer (fp) mode")

Added, thanks.

- Arnaldo

Quoted 19 lines

German

Quoted 17 lines
---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
Signature · 1 line
- Arnaldo
Reviewed-by on v1 1/1
#4 lore raw
In reply to Michael Petlan
Quoted 17 lines · Michael Petlan

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main
Quoted 4 lines

Adding '--user-callchains' leaves only the wanted symbols in the chain.

Since you are the patch's author, it's not necessary to add your tested tag.

Quoted 1 line

With addressing German's comment for "excluding kernel callchains":

Quoted 20 lines
---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
Signature · 1 line
2.18.4
#5 lore raw

Em Tue, Jun 14, 2022 at 09:17:04PM +0800, Leo Yan escreveu:

Quoted 18 lines · Michael Petlan
Quoted 17 lines

The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output:

    610 leaf
    62f parent
    648 main

However, without excluding user callchains, the output might look like:

	ffffc2ff40ef1b5c arch_local_irq_enable
	ffffc2ff419d032c __schedule
	ffffc2ff419d06c0 schedule
	ffffc2ff40e4da30 do_notify_resume
	ffffc2ff40e421b0 work_pending
	             610 leaf
	             62f parent
	             648 main
Quoted 7 lines
Quoted 4 lines

Adding '--user-callchains' leaves only the wanted symbols in the chain.

Since you are the patch's author, it's not necessary to add your tested tag.

Right, removed, we expect authors test their patches :-)

Quoted 3 lines
Quoted 1 line

With addressing German's comment for "excluding kernel callchains":

Addressed.

Quoted 1 line

Thanks, added.

- Arnaldo

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/tests/shell/test_arm_callgraph_fp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +1 -1
index 6ffbb27afaba..ec108d45d3c6 100755
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
Signature · 1 line
2.18.4
Signature · 1 line
- Arnaldo
#6 lore raw

On Tue, Jun 14, 2022 at 04:09:48PM -0300, Arnaldo Carvalho de Melo wrote:

[...]

Quoted 7 lines
Quoted 1 line

With addressing German's comment for "excluding kernel callchains":

Addressed.

Quoted 1 line

Thanks, added.

Thanks a lot, Arnaldo!

#7 lore raw
Quoted 10 lines · Leo Yan

On Tue, Jun 14, 2022 at 04:09:48PM -0300, Arnaldo Carvalho de Melo wrote:

[...]

Quoted 5 lines
Quoted 1 line

With addressing German's comment for "excluding kernel callchains":

Addressed.

Quoted 1 line

Thanks, added.

Thanks a lot, Arnaldo!

+1, thank you for the edits and merging