<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/lib/traceevent/kbuffer-parse.c, branch 0x221E-v0.0-v7.0</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0-v7.0</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0-v7.0'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-12-14T14:16:12Z</updated>
<entry>
<title>tools lib traceevent: Remove libtraceevent</title>
<updated>2022-12-14T14:16:12Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2022-11-30T06:29:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4171925aa9f3f7bf57b100238f148b50c45c3b1b'/>
<id>urn:sha1:4171925aa9f3f7bf57b100238f148b50c45c3b1b</id>
<content type='text'>
libtraceevent is now out-of-date and it is better to depend on the
system version. Remove this code that is no longer depended upon by
any builds.

Committer notes:

Removed the removed tools/lib/traceevent/ from tools/perf/MANIFEST, so
that 'make perf-tar-src-pkg' works.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Acked-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lore.kernel.org/lkml/20221130062935.2219247-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Add proper KBUFFER_TYPE_TIME_STAMP handling</title>
<updated>2020-07-03T11:45:38Z</updated>
<author>
<name>Tom Zanussi</name>
<email>zanussi@kernel.org</email>
</author>
<published>2020-07-02T18:53:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2160d6c8a13e685b7b2bacbe9cd1e9600506a05f'/>
<id>urn:sha1:2160d6c8a13e685b7b2bacbe9cd1e9600506a05f</id>
<content type='text'>
Kernel commit dc4e2801d400 (ring-buffer: Redefine the unimplemented
RINGBUF_TYPE_TIME_STAMP) changed the way the ring buffer timestamps work
- after that commit the previously unimplemented RINGBUF_TYPE_TIME_STAMP
type causes the time delta to be used as a timestamp rather than a delta
to be added to the timestamp.

The trace-cmd code didn't get updated to handle this, so misinterprets
the event data for this case, which causes a cascade of errors,
including trace-report not being able to identify synthetic (or any
other) events generated by the histogram code (which uses TIME_STAMP
mode).  For example, the following triggers along with the trace-cmd
shown cause an UNKNOWN_EVENT error and trace-cmd report crash:

  # echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' &gt; /sys/kernel/debug/tracing/synthetic_events

  # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' &gt; /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
  # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).trace(wakeup_latency,$wakeup_lat,next_pid,next_comm) if next_comm=="ping"' &gt; /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
  # echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' &gt; /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger

  # trace-cmd record -e wakeup_latency -e sched_wakeup -f comm==\"ping\" ping localhost -c 5

  # trace-cmd report
  CPU 0 is empty
  CPU 1 is empty
  CPU 2 is empty
  CPU 3 is empty
  CPU 5 is empty
  CPU 6 is empty
  CPU 7 is empty
  cpus=8
    ug! no event found for type 0
  [UNKNOWN TYPE 0]
    ug! no event found for type 11520
  Segmentation fault (core dumped)

After this patch we get the correct interpretation and the events are
shown properly:

  # trace-cmd report
  CPU 0 is empty
  CPU 1 is empty
  CPU 2 is empty
  CPU 3 is empty
  CPU 5 is empty
  CPU 6 is empty
  CPU 7 is empty
  cpus=8
          &lt;idle&gt;-0     [004] 23284.341392: sched_wakeup:         ping:12031 [120] success=1 CPU:004
          &lt;idle&gt;-0     [004] 23284.341464: wakeup_latency:       lat=58, pid=12031, comm=ping
          &lt;idle&gt;-0     [004] 23285.365303: sched_wakeup:         ping:12031 [120] success=1 CPU:004
          &lt;idle&gt;-0     [004] 23285.365382: wakeup_latency:       lat=64, pid=12031, comm=ping
          &lt;idle&gt;-0     [004] 23286.389290: sched_wakeup:         ping:12031 [120] success=1 CPU:004
          &lt;idle&gt;-0     [004] 23286.389378: wakeup_latency:       lat=72, pid=12031, comm=ping
          &lt;idle&gt;-0     [004] 23287.413213: sched_wakeup:         ping:12031 [120] success=1 CPU:004
          &lt;idle&gt;-0     [004] 23287.413291: wakeup_latency:       lat=64, pid=12031, comm=ping

Link: http://lkml.kernel.org/r/1567628224.13841.4.camel@kernel.org
Link: http://lore.kernel.org/linux-trace-devel/20200625100516.365338-3-tz.stoyanov@gmail.com

Signed-off-by: Tom Zanussi &lt;zanussi@kernel.org&gt;
[ Ported from trace-cmd.git ]
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: linux-trace-devel@vger.kernel.org
Link: http://lore.kernel.org/lkml/20200702185703.785094515@goodmis.org
Signed-off-by: Tzvetomir Stoyanov (VMware) &lt;tz.stoyanov@gmail.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Add API to read time information from kbuffer</title>
<updated>2020-07-03T11:30:10Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2020-07-02T18:53:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=374855c5e4a76f7cc7f9aeb613c54929510eff18'/>
<id>urn:sha1:374855c5e4a76f7cc7f9aeb613c54929510eff18</id>
<content type='text'>
Add the functions kbuffer_subbuf_timestamp() and kbuffer_ptr_delta() to
get the timing data stored in the ring buffer that is used to produced
the time stamps of the records.

This is useful for tools like trace-cmd to be able to display the
content of the read data to understand why the records show the time
stamps that they do.

Link: http://lore.kernel.org/linux-trace-devel/20200625100516.365338-2-tz.stoyanov@gmail.com

Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
[ Ported from trace-cmd.git ]
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: linux-trace-devel@vger.kernel.org
Link: http://lore.kernel.org/lkml/20200702185703.619656282@goodmis.org
Signed-off-by: Tzvetomir Stoyanov (VMware) &lt;tz.stoyanov@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>libtraceevent: Remove unneeded semicolon</title>
<updated>2020-04-30T13:48:32Z</updated>
<author>
<name>Zou Wei</name>
<email>zou_wei@huawei.com</email>
</author>
<published>2020-04-28T09:12:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eebe80c982546ce1041b7dcf3c461406f1e7e88f'/>
<id>urn:sha1:eebe80c982546ce1041b7dcf3c461406f1e7e88f</id>
<content type='text'>
Fixes coccicheck warning:

 tools/lib/traceevent/kbuffer-parse.c:441:2-3: Unneeded semicolon

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zou Wei &lt;zou_wei@huawei.com&gt;
Acked-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Link: http://lore.kernel.org/lkml/1588065121-71236-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Add more debugging to see various internal ring buffer entries</title>
<updated>2019-04-01T18:18:09Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2019-04-01T16:43:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=70df6a7311186a7ab0b19f481dee4ca540a73837'/>
<id>urn:sha1:70df6a7311186a7ab0b19f481dee4ca540a73837</id>
<content type='text'>
When trace-cmd report --debug is set, show the internal ring buffer
entries like time-extends and padding. This requires adding new kbuffer
API to retrieve these items.

Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Tzvetomir Stoyanov &lt;tstoyanov@vmware.com&gt;
Link: http://lkml.kernel.org/r/20190401164343.257591565@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Change to SPDX License format</title>
<updated>2018-08-20T11:54:58Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2018-08-16T15:10:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6ab025ed444cfd1f6cc93c05a977550ce82c8ea1'/>
<id>urn:sha1:6ab025ed444cfd1f6cc93c05a977550ce82c8ea1</id>
<content type='text'>
Replace the GPL text with SPDX tags in the tools/lib/traceevent files.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Tzvetomir Stoyanov (VMware) &lt;tz.stoyanov@gmail.com&gt;
Cc: Yordan Karadzhov (VMware) &lt;y.karadz@gmail.com&gt;
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180816111015.125e0f25@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Add UL suffix to MISSING_EVENTS</title>
<updated>2018-01-17T13:22:49Z</updated>
<author>
<name>Michael Sartain</name>
<email>mikesart@fastmail.com</email>
</author>
<published>2018-01-12T00:47:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6d36ce261614fbac3557cc58ba6a33424944c8a2'/>
<id>urn:sha1:6d36ce261614fbac3557cc58ba6a33424944c8a2</id>
<content type='text'>
Add UL suffix to MISSING_EVENTS since ints shouldn't be left shifted by 31.

Signed-off-by: Michael Sartain &lt;mikesart@fastmail.com&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20171016165542.13038-4-mikesart@fastmail.com
Link: http://lkml.kernel.org/r/20180112004822.829533885@goodmis.org
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP</title>
<updated>2017-02-13T20:22:32Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2017-02-13T17:11:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=14e4d7e0abfdefabea2b8796c5a8b2b9c77b5326'/>
<id>urn:sha1:14e4d7e0abfdefabea2b8796c5a8b2b9c77b5326</id>
<content type='text'>
A undefined value was being used for the OLD_RING_BUFFER_TYPE_TIME_STAMP
case entry, as the 'length' variable was not being initialized, fix it.

Caught by the reporter when building tools/perf/ using clang, which emmitted
this warning:

  kbuffer-parse.c:312:7: warning: variable 'length' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
          case OLD_RINGBUF_TYPE_TIME_EXTEND:
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  kbuffer-parse.c:339:29: note: uninitialized use occurs here
          kbuf-&gt;next = kbuf-&gt;index + length;
                                   ^~~~~~
  kbuffer-parse.c:297:21: note: initialize the variable 'length' to silence this warning
          unsigned int length;
                             ^
                              = 0

Reported-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
Link: http://lkml.kernel.org/r/20170213121418.47f279e8@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Fix kbuffer_read_at_offset()</title>
<updated>2016-10-05T14:36:22Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2016-10-01T10:17:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a130347973c408c0e0017a52c74cbc3226c1f0ef'/>
<id>urn:sha1:a130347973c408c0e0017a52c74cbc3226c1f0ef</id>
<content type='text'>
When it's called with an offset less than or equal to the first event,
it'll return a garbage value since the data is not initialized.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20161001101700.29146-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib traceevent: Add way to find sub buffer boundary</title>
<updated>2015-03-24T15:22:09Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-03-24T13:57:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=82ac952be6348dc072dcfd80a2dcb511d0cd6bea'/>
<id>urn:sha1:82ac952be6348dc072dcfd80a2dcb511d0cd6bea</id>
<content type='text'>
For debugging purposes, it may be helpful for the kbuffer library to flag
when crossing a sub buffer.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lkml.kernel.org/r/20150324135923.650983637@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
