mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
perf tools: Fix auto-complete on aarch64
[ Upstream commit ffd1240e8f0814262ceb957dbe961f6e0aef1e7a ]
On aarch64 CPU related events are not under event_source/devices/cpu/events,
they're under event_source/devices/armv8_pmuv3_0/events on my machine.
Using current auto-complete script will generate below error:
[root@localhost bin]# perf stat -e
ls: cannot access '/sys/bus/event_source/devices/cpu/events': No such file or directory
Fix this by not testing /sys/bus/event_source/devices/cpu/events on
aarch64 machine.
Fixes: 74cd5815d9 ("perf tool: Improve bash command line auto-complete for multiple events with comma")
Reviewed-by: James Clark <[email protected]>
Signed-off-by: Yicong Yang <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
5d32f3e922
commit
090a22f599
1 changed files with 8 additions and 3 deletions
|
|
@ -165,7 +165,12 @@ __perf_main ()
|
|||
|
||||
local cur1=${COMP_WORDS[COMP_CWORD]}
|
||||
local raw_evts=$($cmd list --raw-dump)
|
||||
local arr s tmp result
|
||||
local arr s tmp result cpu_evts
|
||||
|
||||
# aarch64 doesn't have /sys/bus/event_source/devices/cpu/events
|
||||
if [[ `uname -m` != aarch64 ]]; then
|
||||
cpu_evts=$(ls /sys/bus/event_source/devices/cpu/events)
|
||||
fi
|
||||
|
||||
if [[ "$cur1" == */* && ${cur1#*/} =~ ^[A-Z] ]]; then
|
||||
OLD_IFS="$IFS"
|
||||
|
|
@ -183,9 +188,9 @@ __perf_main ()
|
|||
fi
|
||||
done
|
||||
|
||||
evts=${result}" "$(ls /sys/bus/event_source/devices/cpu/events)
|
||||
evts=${result}" "${cpu_evts}
|
||||
else
|
||||
evts=${raw_evts}" "$(ls /sys/bus/event_source/devices/cpu/events)
|
||||
evts=${raw_evts}" "${cpu_evts}
|
||||
fi
|
||||
|
||||
if [[ "$cur1" == , ]]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue