Re: Flaw in "random32: update the net random state on interrupt and activity"

12 messages, 3 authors, 2021-01-08 · open the first message on its own page

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-12 06:03:22

[ 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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-12 06:35:52

[ INSTRUCTIONS ]

echo 1 > /proc/sys/kernel/sched_schedstats
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

/home/dileks/bin/perf record -e random:prandom_u32 -a -g -- sleep 10

That gives me now some perf data.

- Sedat -

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-12 07:13:40

On Wed, Aug 12, 2020 at 8:35 AM Sedat Dilek [off-list ref] wrote:
[ INSTRUCTIONS ]

echo 1 > /proc/sys/kernel/sched_schedstats
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

/home/dileks/bin/perf record -e random:prandom_u32 -a -g -- sleep 10

That gives me now some perf data.
I perf-probed for tcp_v4_connect:

/home/dileks/bin/perf probe --add tcp_v4_connect

/home/dileks/bin/perf list | grep probe:
  probe:tcp_v4_connect                               [Tracepoint event]

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

/home/dileks/bin/perf record -e
probe:tcp_v4_connect,random:prandom_u32 -a -g -- sleep 10

/home/dileks/bin/perf report --stdio

- Sedat -

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Eric Dumazet <hidden>
Date: 2020-08-12 15:17:25


On 8/11/20 11:03 PM, Sedat Dilek wrote:
[ 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?

perf record -a -g -e random:prandom_u32  sleep 5

Then something like

perf report --no-children

or "perf script"
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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-12 16:20:37

On Wed, Aug 12, 2020 at 5:16 PM Eric Dumazet [off-list ref] wrote:


On 8/11/20 11:03 PM, Sedat Dilek wrote:
quoted
[ 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?

perf record -a -g -e random:prandom_u32  sleep 5

Then something like

perf report --no-children

or "perf script"
I tried some similar perf record/report settings this morning.

Would you mind sending out a patch for the prandom_u32/trace diff?

I have it here in my local Git as:

(for-5.8/random32-prandom_u32-trace-edumazet) random: Add a trace
event for prandom_u32()

Feel free to add my:
Tested-by: Sedat Dilek <redacted>

Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
But I cannot judge if it is helpful in the discussion or not.

Thanks.

- Sedat -


quoted
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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Eric Dumazet <edumazet@google.com>
Date: 2020-08-12 16:25:06

On Wed, Aug 12, 2020 at 9:20 AM Sedat Dilek [off-list ref] wrote:
On Wed, Aug 12, 2020 at 5:16 PM Eric Dumazet [off-list ref] wrote:
quoted


On 8/11/20 11:03 PM, Sedat Dilek wrote:
quoted
[ 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?

perf record -a -g -e random:prandom_u32  sleep 5

Then something like

perf report --no-children

or "perf script"
I tried some similar perf record/report settings this morning.

Would you mind sending out a patch for the prandom_u32/trace diff?

I have it here in my local Git as:

(for-5.8/random32-prandom_u32-trace-edumazet) random: Add a trace
event for prandom_u32()

Feel free to add my:
Tested-by: Sedat Dilek <redacted>

Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
But I cannot judge if it is helpful in the discussion or not.

Thanks.

- Sedat -


quoted
quoted
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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-12 16:38:34

On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
On Wed, Aug 12, 2020 at 9:20 AM Sedat Dilek [off-list ref] wrote:
quoted
On Wed, Aug 12, 2020 at 5:16 PM Eric Dumazet [off-list ref] wrote:
quoted


On 8/11/20 11:03 PM, Sedat Dilek wrote:
quoted
[ 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?

perf record -a -g -e random:prandom_u32  sleep 5

Then something like

perf report --no-children

or "perf script"
I tried some similar perf record/report settings this morning.

Would you mind sending out a patch for the prandom_u32/trace diff?

I have it here in my local Git as:

(for-5.8/random32-prandom_u32-trace-edumazet) random: Add a trace
event for prandom_u32()

Feel free to add my:
Tested-by: Sedat Dilek <redacted>

Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Great!

Feel free to add my: Tested-by: Sedat Dilek [off-list ref]

- Sedat -
quoted
But I cannot judge if it is helpful in the discussion or not.

Thanks.

- Sedat -


quoted
quoted
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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2020-08-19 09:51:56

On Wed, Aug 12, 2020 at 6:38 PM Sedat Dilek [off-list ref] wrote:
On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
quoted
On Wed, Aug 12, 2020 at 9:20 AM Sedat Dilek [off-list ref] wrote:
quoted
On Wed, Aug 12, 2020 at 5:16 PM Eric Dumazet [off-list ref] wrote:
quoted


On 8/11/20 11:03 PM, Sedat Dilek wrote:
quoted
[ 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?

perf record -a -g -e random:prandom_u32  sleep 5

Then something like

perf report --no-children

or "perf script"
I tried some similar perf record/report settings this morning.

Would you mind sending out a patch for the prandom_u32/trace diff?

I have it here in my local Git as:

(for-5.8/random32-prandom_u32-trace-edumazet) random: Add a trace
event for prandom_u32()

Feel free to add my:
Tested-by: Sedat Dilek <redacted>

Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Great!

Feel free to add my: Tested-by: Sedat Dilek [off-list ref]
Hi Eric,

I forgot: Can you CC me on that planned TCP patch?

Thanks.

Regards,
- Sedat -
- Sedat -
quoted
quoted
But I cannot judge if it is helpful in the discussion or not.

Thanks.

- Sedat -


quoted
quoted
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

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2021-01-08 13:09:16

On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
quoted
Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Ping.

What is the status of this?

- Sedat -

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2021-01-08 13:52:53

On Fri, Jan 8, 2021 at 2:08 PM Sedat Dilek [off-list ref] wrote:
On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
quoted
quoted
Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Ping.

What is the status of this?
I am attaching the updated diff against latest Linus Git.

- Sedat -

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Eric Dumazet <edumazet@google.com>
Date: 2021-01-08 15:42:38

On Fri, Jan 8, 2021 at 2:51 PM Sedat Dilek [off-list ref] wrote:
On Fri, Jan 8, 2021 at 2:08 PM Sedat Dilek [off-list ref] wrote:
quoted
On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
quoted
quoted
Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Ping.

What is the status of this?
I am attaching the updated diff against latest Linus Git.

- Sedat -
I have decided to not pursue this.

skb->hash might be populated by non random data if fed from a
problematic source/driver.

Better to leave current code in place, there is no convincing argument
to change this.

Re: Flaw in "random32: update the net random state on interrupt and activity"

From: Sedat Dilek <hidden>
Date: 2021-01-08 21:33:23

On Fri, Jan 8, 2021 at 4:41 PM Eric Dumazet [off-list ref] wrote:
On Fri, Jan 8, 2021 at 2:51 PM Sedat Dilek [off-list ref] wrote:
quoted
On Fri, Jan 8, 2021 at 2:08 PM Sedat Dilek [off-list ref] wrote:
quoted
On Wed, Aug 12, 2020 at 6:25 PM Eric Dumazet [off-list ref] wrote:
quoted
quoted
Also, I tried the diff for tcp_conn_request...
With removing the call to prandom_u32() not useful for
prandom_u32/tracing via perf.
I am planning to send the TCP patch once net-next is open. (probably next week)
Ping.

What is the status of this?
I am attaching the updated diff against latest Linus Git.

- Sedat -
I have decided to not pursue this.

skb->hash might be populated by non random data if fed from a
problematic source/driver.

Better to leave current code in place, there is no convincing argument
to change this.
OK, Thanks for the clarification.

- Sedat -
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help