netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: sedat.dilek@gmail.com
Cc: Eric Dumazet <eric.dumazet@gmail.com>, netdev <netdev@vger.kernel.org>
Subject: Re: Flaw in "random32: update the net random state on interrupt and activity"
Date: Wed, 12 Aug 2020 09:24:51 -0700	[thread overview]
Message-ID: <CANn89iJvw55jeWDVzyfNewr-=pXiEwCkG=c5eu6j8EeiD=PN4g@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUW+v5ZHq4FGt7JPyGOL7y7wUrw1N9BHtiuE-EmwqQrcQw@mail.gmail.com>

On Wed, Aug 12, 2020 at 9:20 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Wed, Aug 12, 2020 at 5:16 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >
> >
> >
> > 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"
> >
>
> 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 <sedat.dilek@gmail.com>
>
> 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 -
>
>
>
> > >
> > > 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
> > >

  reply	other threads:[~2020-08-12 16:25 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12  6:03 Flaw in "random32: update the net random state on interrupt and activity" Sedat Dilek
2020-08-12  6:35 ` Sedat Dilek
2020-08-12  7:13   ` Sedat Dilek
2020-08-12 15:16 ` Eric Dumazet
2020-08-12 16:20   ` Sedat Dilek
2020-08-12 16:24     ` Eric Dumazet [this message]
2020-08-12 16:38       ` Sedat Dilek
2020-08-19  9:51         ` Sedat Dilek
2021-01-08 13:08       ` Sedat Dilek
2021-01-08 13:51         ` Sedat Dilek
2021-01-08 15:41           ` Eric Dumazet
2021-01-08 21:32             ` Sedat Dilek
  -- strict thread matches above, loose matches on Subject: below --
2020-08-08 15:26 George Spelvin
2020-08-08 17:07 ` Andy Lutomirski
2020-08-08 18:08   ` Willy Tarreau
2020-08-08 18:13   ` Linus Torvalds
2020-08-08 19:03   ` George Spelvin
2020-08-08 19:49     ` Andy Lutomirski
2020-08-08 21:29       ` George Spelvin
2020-08-08 17:44 ` Willy Tarreau
2020-08-08 18:19   ` Linus Torvalds
2020-08-08 18:53     ` Willy Tarreau
2020-08-08 20:47     ` George Spelvin
2020-08-08 20:52       ` Linus Torvalds
2020-08-08 22:27         ` George Spelvin
2020-08-09  2:07           ` Linus Torvalds
2020-08-11 16:01             ` Eric Dumazet
2020-08-08 19:18   ` Florian Westphal
2020-08-08 20:59     ` George Spelvin
2020-08-08 21:18     ` Willy Tarreau
2020-08-08 20:08   ` George Spelvin
2020-08-08 20:47     ` Linus Torvalds
     [not found] <9f74230f-ba4d-2e19-5751-79dc2ab59877@gmail.com>
2020-08-05  0:57 ` Marc Plumb
2020-08-05  1:02 ` Linus Torvalds
2020-08-05  2:49 ` Willy Tarreau
2020-08-05 15:34   ` tytso
2020-08-05 16:06     ` Marc Plumb
2020-08-05 19:38       ` Willy Tarreau
2020-08-05 22:21         ` Marc Plumb
2020-08-06  6:30           ` Willy Tarreau
2020-08-06 17:18             ` Marc Plumb
2020-08-07  7:03               ` Willy Tarreau
2020-08-07 16:52                 ` Marc Plumb
2020-08-07 17:43                   ` Willy Tarreau
     [not found]                     ` <C74EC3BC-F892-416F-A95C-4ACFC96EEECE@amacapital.net>
2020-08-07 18:04                       ` Willy Tarreau
2020-08-07 18:10                       ` Linus Torvalds
2020-08-07 19:08                         ` Andy Lutomirski
2020-08-07 19:21                           ` Linus Torvalds
2020-08-07 19:33                             ` Andy Lutomirski
2020-08-07 19:56                               ` Linus Torvalds
2020-08-07 20:16                                 ` Andy Lutomirski
2020-08-07 20:24                                   ` Linus Torvalds
2020-08-07 19:59                     ` Marc Plumb
2020-08-07 22:19                       ` Willy Tarreau
2020-08-07 22:45                         ` Marc Plumb
2020-08-07 23:11                           ` Willy Tarreau
2020-08-05 22:05       ` tytso
2020-08-05 23:03         ` Andy Lutomirski
2020-08-06 17:00         ` Marc Plumb
2020-08-05 16:24     ` Jason A. Donenfeld
2020-08-05 16:53     ` Willy Tarreau
2020-08-05 15:44   ` Marc Plumb
2020-08-05 16:39     ` Linus Torvalds
2020-08-05 23:49       ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANn89iJvw55jeWDVzyfNewr-=pXiEwCkG=c5eu6j8EeiD=PN4g@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sedat.dilek@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).