mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 20:32:22 +00:00
Probes fixes for 6.4-rc4:
- Return NULL if the trace_probe list on trace_probe_event is empty. - selftests/ftrace: Choose testing symbol name for filtering feature from sample data instead of fixed symbol. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEh7BulGwFlgAOi5DV2/sHvwUrPxsFAmR640AACgkQ2/sHvwUr PxugGgf/YwwocmUqiEtTukTB7fzoAjYyQXr0YaJM+DjeZXMqAJ4dl9tV1/AmAL4j iWtZd53aolTym/3P2VADfSc4xiyWjFdkYv7zRPjpqfMg3XsELJgshwz+12dmmMdx 0uco1l2/Ge3JNPK6BuWaO3V44QjoPSgiRsmxxKLh5K7M9V5swL7fadoLtins1B0r TVVqdyEHQkZLTByexg7wHYd/ro+4lexv1yhvyP4rEmYRPDoR56eOF2zwcQMHPvaY qstdP2ce6m5rG0gp4TsY7oRkezb64y903hNQuumoU6VR9nI3IK4PZjuX5/xns2By G9mRaOqb02+UmP+HhX4QGmr92G9Vyw== =o07w -----END PGP SIGNATURE----- Merge tag 'probes-fixes-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes fixes from Masami Hiramatsu: - Return NULL if the trace_probe list on trace_probe_event is empty - selftests/ftrace: Choose testing symbol name for filtering feature from sample data instead of fixed symbol * tag 'probes-fixes-6.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: selftests/ftrace: Choose target function for filter test from samples tracing/probe: trace_probe_primary_from_call(): checked list_first_entry
This commit is contained in:
commit
51f269a6ec
@ -308,7 +308,7 @@ trace_probe_primary_from_call(struct trace_event_call *call)
|
||||
{
|
||||
struct trace_probe_event *tpe = trace_probe_event_from_call(call);
|
||||
|
||||
return list_first_entry(&tpe->probes, struct trace_probe, list);
|
||||
return list_first_entry_or_null(&tpe->probes, struct trace_probe, list);
|
||||
}
|
||||
|
||||
static inline struct list_head *trace_probe_probe_list(struct trace_probe *tp)
|
||||
|
@ -9,18 +9,33 @@ fail() { #msg
|
||||
exit_fail
|
||||
}
|
||||
|
||||
echo "Test event filter function name"
|
||||
sample_events() {
|
||||
echo > trace
|
||||
echo 1 > events/kmem/kmem_cache_free/enable
|
||||
echo 1 > tracing_on
|
||||
ls > /dev/null
|
||||
echo 0 > tracing_on
|
||||
echo 0 > events/kmem/kmem_cache_free/enable
|
||||
}
|
||||
|
||||
echo 0 > tracing_on
|
||||
echo 0 > events/enable
|
||||
echo > trace
|
||||
echo 'call_site.function == exit_mmap' > events/kmem/kmem_cache_free/filter
|
||||
echo 1 > events/kmem/kmem_cache_free/enable
|
||||
echo 1 > tracing_on
|
||||
ls > /dev/null
|
||||
echo 0 > events/kmem/kmem_cache_free/enable
|
||||
|
||||
hitcnt=`grep kmem_cache_free trace| grep exit_mmap | wc -l`
|
||||
misscnt=`grep kmem_cache_free trace| grep -v exit_mmap | wc -l`
|
||||
echo "Get the most frequently calling function"
|
||||
sample_events
|
||||
|
||||
target_func=`cut -d: -f3 trace | sed 's/call_site=\([^+]*\)+0x.*/\1/' | sort | uniq -c | sort | tail -n 1 | sed 's/^[ 0-9]*//'`
|
||||
if [ -z "$target_func" ]; then
|
||||
exit_fail
|
||||
fi
|
||||
echo > trace
|
||||
|
||||
echo "Test event filter function name"
|
||||
echo "call_site.function == $target_func" > events/kmem/kmem_cache_free/filter
|
||||
sample_events
|
||||
|
||||
hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l`
|
||||
misscnt=`grep kmem_cache_free trace| grep -v $target_func | wc -l`
|
||||
|
||||
if [ $hitcnt -eq 0 ]; then
|
||||
exit_fail
|
||||
@ -30,20 +45,14 @@ if [ $misscnt -gt 0 ]; then
|
||||
exit_fail
|
||||
fi
|
||||
|
||||
address=`grep ' exit_mmap$' /proc/kallsyms | cut -d' ' -f1`
|
||||
address=`grep " ${target_func}\$" /proc/kallsyms | cut -d' ' -f1`
|
||||
|
||||
echo "Test event filter function address"
|
||||
echo 0 > tracing_on
|
||||
echo 0 > events/enable
|
||||
echo > trace
|
||||
echo "call_site.function == 0x$address" > events/kmem/kmem_cache_free/filter
|
||||
echo 1 > events/kmem/kmem_cache_free/enable
|
||||
echo 1 > tracing_on
|
||||
sleep 1
|
||||
echo 0 > events/kmem/kmem_cache_free/enable
|
||||
sample_events
|
||||
|
||||
hitcnt=`grep kmem_cache_free trace| grep exit_mmap | wc -l`
|
||||
misscnt=`grep kmem_cache_free trace| grep -v exit_mmap | wc -l`
|
||||
hitcnt=`grep kmem_cache_free trace| grep $target_func | wc -l`
|
||||
misscnt=`grep kmem_cache_free trace| grep -v $target_func | wc -l`
|
||||
|
||||
if [ $hitcnt -eq 0 ]; then
|
||||
exit_fail
|
||||
|
Loading…
Reference in New Issue
Block a user