Skip to content

Commit

Permalink
address the reviewer's comment, except for the html output
Browse files Browse the repository at this point in the history
  • Loading branch information
TianyouLi committed Dec 8, 2024
1 parent 38f138a commit 49a89db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/report/table_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1906,9 +1906,9 @@ func codePathFrequencyTableValues(outputs map[string]script.ScriptOutput) []Fiel
func kernelLockAnalysisTableValues(outputs map[string]script.ScriptOutput) []Field {
fields := []Field{
{Name: "Hotspot without Callstack", Values: []string{sectionValueFromOutput(outputs, "perf_hotspot_no_children")}},
{Name: "Hotspot with Callstack", Values: []string{sectionValueFromOutput(outputs, "perf_hotspot_callgraph")}},
{Name: "Hotspot with Callstack", Values: []string{sectionValueFromOutput(outputs, "perf_hotspot_callgraph")}},
{Name: "Cache2Cache without Callstack", Values: []string{sectionValueFromOutput(outputs, "perf_c2c_no_children")}},
{Name: "Cache2Cache with CallStack", Values: []string{sectionValueFromOutput(outputs, "perf_c2c_callgraph")}},
{Name: "Cache2Cache with CallStack", Values: []string{sectionValueFromOutput(outputs, "perf_c2c_callgraph")}},
{Name: "Lock Contention", Values: []string{sectionValueFromOutput(outputs, "perf_lock_contention")}},
}
return fields
Expand Down
18 changes: 11 additions & 7 deletions internal/script/script_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,17 +976,21 @@ duration=%d
perf record -F $frequency -a -g --call-graph dwarf -W -d --phys-data --sample-cpu -e cycles:pp,instructions:pp,cpu/mem-loads,ldlat=30/P,cpu/mem-stores/P -o perf_hotspot.data -- sleep $duration &
PERF_HOTSPOT_PID=$!
# collect c2c
# perf c2c record -F $frequency -a -g --call-graph dwarf -o perf_c2c.data -- sleep $duration &
# PERF_C2C_PID=$!
# check the availability perf lock -b option
perf lock contention -a -bv --max-stack 20 2>/dev/null -- sleep 0
PERF_LOCK_CONTENTION_BPF=$?
# collect lock
perf lock contention -a -bv --max-stack 20 2>perf_lock_contention.txt -- sleep $duration &
PERF_LOCK_PID=$!
if [ ${PERF_LOCK_CONTENTION_BPF} -eq 0 ]; then
perf lock contention -a -bv --max-stack 20 2>perf_lock_contention.txt -- sleep $duration &
PERF_LOCK_PID=$!
fi
wait ${PERF_HOTSPOT_PID}
# wait ${PERF_C2C_PID}
wait ${PERF_LOCK_PID}
if [ ${PERF_LOCK_CONTENTION_BPF} -eq 0 ]; then
wait ${PERF_LOCK_PID}
fi
# restore perf_event_paranoid and kptr_restrict
echo "$PERF_EVENT_PARANOID" > /proc/sys/kernel/perf_event_paranoid
Expand Down

0 comments on commit 49a89db

Please sign in to comment.