lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Aug 2020 08:03:06 +0200
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     netdev@...r.kernel.org
Subject: Re: Flaw in "random32: update the net random state on interrupt and activity"

[ CC netdev ]
[ Please CC me I am not subscribed to this mailing-list ]

Hi Eric,

I have added your diffs from [0] and have some troubles to display the
prandom_32 trace-events (I mostly followed [1]):

I did:

echo prandom_u32 >> /sys/kernel/debug/tracing/set_event
echo traceon > /sys/kernel/debug/tracing/events/random/prandom_u32/trigger
echo 1 > /sys/kernel/debug/tracing/events/enable

cat /sys/kernel/debug/tracing/set_event | grep prandom
random:prandom_u32
cat /sys/kernel/debug/tracing/events/random/prandom_u32/trigger
traceon:unlimited
cat /sys/kernel/debug/tracing/events/enable
X

Following [2] and [3] I wanted to use perf:

# /home/dileks/bin/perf list | grep prandom
  random:prandom_u32                                 [Tracepoint event]

Following the example in [4]:

# /home/dileks/bin/perf probe --add tcp_sendmsg
# /home/dileks/bin/perf record -e probe:tcp_sendmsg -a -g -- sleep 10
# /home/dileks/bin/perf report --stdio

That gives me a report.

Adapting:

# /home/dileks/bin/perf probe --add tcp_conn_request

# /home/dileks/bin/perf list | grep probe:
  probe:tcp_conn_request                             [Tracepoint event]
  probe:tcp_sendmsg                                  [Tracepoint event]

# home/dileks/bin/perf record -e probe:tcp_conn_request -a -g -- sleep 10

# /home/dileks/bin/perf report --stdio
Error:
The perf.data data has no samples!
# To display the perf.data header info, please use
--header/--header-only options.
#

# /home/dileks/bin/perf report --stdio --header-only
# ========
# captured on    : Wed Aug 12 07:39:42 2020
# header version : 1
# data offset    : 440
# data size      : 2123144
# feat offset    : 2123584
# hostname : iniza
# os release : 5.8.1-2-amd64-llvm11-ias
# perf version : 5.8.1
# arch : x86_64
# nrcpus online : 4
# nrcpus avail : 4
# cpudesc : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz
# cpuid : GenuineIntel,6,42,7
# total memory : 8046012 kB
# cmdline : /home/dileks/bin/perf record -e probe:tcp_conn_request -a
-g -- sleep 10
# event : name = probe:tcp_conn_request, , id = { 304, 305, 306, 307
}, type = 2, size = 120, config = 0x866, { sample_period, sample_freq
} = 1, sample_type = IP|TID|TIME|CALLCHAIN|CPU|PERIO>
# event : name = dummy:HG, , id = { 308, 309, 310, 311 }, type = 1,
size = 120, config = 0x9, { sample_period, sample_freq } = 4000,
sample_type = IP|TID|TIME|CALLCHAIN|CPU|PERIOD|IDENTIFIER,>
# CPU_TOPOLOGY info available, use -I to display
# NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: software = 1, power = 14, uprobe = 7, cpu = 4,
cstate_core = 12, breakpoint = 5, uncore_cbox_0 = 9, tracepoint = 2,
cstate_pkg = 13, uncore_arb = 11, kprobe = 6, i915 = 15, ms>
# CACHE info available, use -I to display
# time of first sample : 0.000000
# time of last sample : 0.000000
# sample duration :      0.000 ms
# MEM_TOPOLOGY info available, use -I to display
# bpf_prog_info 3: bpf_prog_6deef7357e7b4530 addr 0xffffffffc01d7834 size 66
# bpf_prog_info 4: bpf_prog_6deef7357e7b4530 addr 0xffffffffc01df7e8 size 66
# bpf_prog_info 5: bpf_prog_6deef7357e7b4530 addr 0xffffffffc041ca18 size 66
# bpf_prog_info 6: bpf_prog_6deef7357e7b4530 addr 0xffffffffc041eb58 size 66
# bpf_prog_info 7: bpf_prog_6deef7357e7b4530 addr 0xffffffffc1061dc0 size 66
# bpf_prog_info 8: bpf_prog_6deef7357e7b4530 addr 0xffffffffc1063388 size 66
# bpf_prog_info 12: bpf_prog_6deef7357e7b4530 addr 0xffffffffc129c244 size 66
# bpf_prog_info 13: bpf_prog_6deef7357e7b4530 addr 0xffffffffc129e8c0 size 66
# cpu pmu capabilities: branches=16, max_precise=2, pmu_name=sandybridge
# missing features: BRANCH_STACK GROUP_DESC AUXTRACE STAT CLOCKID
DIR_FORMAT COMPRESSED
# ========
#

In dmesg I see:

[Wed Aug 12 07:30:52 2020] Scheduler tracepoints stat_sleep,
stat_iowait, stat_blocked and stat_runtime require the kernel
parameter schedstats=enable or kernel.sched_schedstats=1

CONFIG_SCHEDSTATS=y is set.

# echo 1 > /proc/sys/kernel/sched_schedstats
# cat /proc/sys/kernel/sched_schedstats
1

Still seeing:
# /home/dileks/bin/perf report --stdio
Error:
The perf.data data has no samples!
# To display the perf.data header info, please use
--header/--header-only options.
#

Do I miss to set some required Kconfigs?
I have attached my latest kernel-config file.

So I need a helping hand how to trace prandom_u32 events in general?

How to add it as a kernel-boot-parameter (see [4])?

Any help appreciated and thanks in advance.

Thanks.

Regards,
- Sedat -

[0] https://marc.info/?l=linux-netdev&m=159716173516111&w=2
[1] https://www.kernel.org/doc/html/v5.8/trace/events.html
[2] http://www.brendangregg.com/perf.html
[3] http://www.brendangregg.com/perf.html#DynamicTracing
[4] https://www.kernel.org/doc/html/v5.8/trace/events.html#boot-option

Download attachment "config-5.8.1-2-amd64-llvm11-ias" of type "application/octet-stream" (233280 bytes)

Powered by blists - more mailing lists