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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  3 Aug 2021 00:30:10 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     linux-kernel@...r.kernel.org, Tom Zanussi <zanussi@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>
Subject: [RFC PATCH 0/3] tracing/boot: Add histogram syntax support in boot-time tracing

Hi,

Here is a series of patches for boot-time tracing to add histogram
syntax extension and fixes a build issue.

Currently, the boot-time tracing only supports per-event actions
for setting trigger actions. This is enough for short actions
like 'traceon', 'traceoff', 'snapshot' etc. However, it is not good
for the 'hist' trigger action because it is usually too long to write
it in a single string especially if it has an 'onmatch' action.

Here is the new syntax.

    ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist {
         keys = <KEY>[,...]
         values = <VAL>[,...]
         sort = <SORT-KEY>[,...]
         size = <ENTRIES>
         name = <HISTNAME>
         var { <VAR> = <EXPR> ... }
         pause|continue|clear
         onmax|onchange { var = <VAR>, <ACTION> [= <PARAM>] }
         onmatch { event = <EVENT>, <ACTION> [= <PARAM>] }
         filter = <FILTER>
    }
    
Where <ACTION> is one of below;
    
    trace = <EVENT>, <ARG1>[, ...]
    save = <ARG1>[, ...]
    snapshot

For example,

initcall.initcall_finish.actions =
"hist:keys=func:lat=common_timestamp.usecs-$ts0:onmatch(initcall.initcall_start).trace(initcall_latency,func,$lat)"

This can be written as below;

initcall.initcall_finish.hist {
    keys = func
    var.lat = common_timestamp.usecs-$ts0
    onmatch {
        event = initcall.initcall_start
        trace = initcall_latency, func, $lat
    }
}

Also, you can add comments for each options.


TODO
====
- This version doesn't support multiple histograms on an event. For
  that purpose, you still need to use per-event 'actions' option.
  Maybe it can be extended to support multiple instance by adding
  '_#NUM' subkey, e.g. "hist._1.keys = ...; hist._2.keys = ...".
- This also doesn't support multiple 'onmatch'/'onmax'/'onchange'
  handler actions.
- Need to expand ktest testcase for checking this syntax.

Tom, this version doesn't make pause/continue/clear mutually exclusive.
And onmatch/onmax/onchange, too. As far as I can see the code, those
can be set on one histogram. But maybe I'm wrong. Please tell me if
there is some limitations or exclusiveness among those options.

Thank you,

---

Masami Hiramatsu (3):
      tracing/boot: Fix a hist trigger dependency for boot time tracing
      tracing/boot: Add per-event histogram action options
      Documentation: tracing: Add histogram syntax to boot-time tracing


 Documentation/trace/boottime-trace.rst |   81 ++++++++++++-
 kernel/trace/trace_boot.c              |  203 ++++++++++++++++++++++++++++++++
 2 files changed, 278 insertions(+), 6 deletions(-)

-- 
Masami Hiramatsu (Linaro) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ