Skip to content

TSC trace clock to nanosecond conversion

Tzvetomir Stoyanov (VMware) linux-trace-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest23 patches 2 repliesIn review
  2. v323 patches 21 repliesSuperseded
  3. v218 patches 14 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v112 patches9 repliesSuperseded

Changes in v4 from the cover letter

- Improved getting the clock for the trace session, if there is no user specified one. The clock of the first host instance is used, instead of the top intstane.
- Improved printing the clocks from the trace file with trace-cmd dump command
- Fixed bugs, addressed Steven's comments.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23trace-cmd: Add initial perf interface in trace-cmd libraryMakefile lib/trace-cmd/Makefile lib/trace-cmd/include/private/trace-cmd-private.h +1 more+131 -00 replies
2/23trace-cmd: Extend trace-cmd dump subcommand to display the clockDocumentation/trace-cmd/trace-cmd-dump.1.txt tracecmd/trace-dump.c tracecmd/trace-usage.c+36 -10 replies
3/23trace-cmd: Save only the selected clock in the trace.dat filelib/trace-cmd/include/private/trace-cmd-private.h lib/trace-cmd/trace-output.c+56 -110 replies
4/23trace-cmd: Internal refactoring, move logic for local tep handler in its own functiontracecmd/trace-record.c+30 -230 replies
5/23trace-cmd: Add new local function to check if a trace clock is supportedtracecmd/trace-record.c+28 -01 reply
6/23trace-cmd: Add new trace-cmd clock tsc2nsectracecmd/include/trace-local.h tracecmd/trace-record.c+155 -40 replies
7/23trace-cmd: Define a new option for tsc2nsec conversionlib/trace-cmd/include/private/trace-cmd-private.h tracecmd/trace-dump.c+20 -00 replies
8/23trace-cmd: Save information for tsc to nanoseconds conversion in trace filetracecmd/trace-record.c+28 -40 replies
9/23trace-cmd: Read information for tsc to nanoseconds conversion from trace filelib/trace-cmd/trace-input.c+18 -00 replies
10/23trace-cmd: Save tsc2nsec clock in trace.dat filelib/trace-cmd/include/private/trace-cmd-private.h lib/trace-cmd/trace-input.c tracecmd/trace-record.c+8 -50 replies
11/23trace-cmd: Append new options into guest trace file at the end of the tracing sessionlib/trace-cmd/trace-timesync.c tracecmd/trace-record.c+1 -10 replies
12/23trace-cmd: Remove unneeded multiply in events timestamp readinglib/trace-cmd/trace-input.c+1 -30 replies
13/23trace-cmd: Perform all timestamp corrections in a single functionlib/trace-cmd/trace-input.c+14 -80 replies
14/23trace-cmd: Convert tsc timestamps to nanosecods when reading trace data from a filelib/trace-cmd/trace-input.c+21 -00 replies
15/23trace-cmd: Set order and priorities when applying timestamp correctionslib/trace-cmd/trace-input.c+13 -140 replies
16/23trace-cmd: Add a new flag to disable any timestamp correctionslib/trace-cmd/include/private/trace-cmd-private.h lib/trace-cmd/trace-input.c+8 -20 replies
17/23trace-cmd: Change "--nodate" option to affect "--date" option onlylib/trace-cmd/trace-input.c+2 -20 replies
18/23trace-cmd: Add new parameter "--raw-ts" to "trace-cmd report" commandlib/trace-cmd/trace-input.c tracecmd/trace-read.c+12 -10 replies
19/23trace-cmd: Print times in TimeShift options as unsigned in trace-cmd dumptracecmd/trace-dump.c+2 -20 replies
20/23trace-cmd: Use tsc clock for host-guest tracing, if availabletracecmd/trace-record.c+67 -300 replies
21/23trace-cmd: Get current clock for host-guest tracing sessiontracecmd/trace-record.c+39 -100 replies
22/23trace-cmd: Save the trace clocks in TRACECLOCK optiontracecmd/trace-record.c+5 -10 replies
23/23trace-cmd: Read at least 8 bytes trace-id optionlib/trace-cmd/trace-input.c+1 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 00/23] TSC trace clock to nanosecond conversion

Added new logic for converting TSC event's timestamps to nanoseconds. This trace clock is used by default in host-guest tracing session in combination with KVM time sync plugin. The parameters for conversion are retrieved by the perf kernel interface.
New option is added to "trace-cmd report" command to force displaying raw time stamps from the trace file, without any corrections to the time stamps.

These changes depend on "Refactoring and improvements of time sync logic" patch set.

v4 changes:
- Improved getting the clock for the trace session, if there is no user specified one. The clock of the first host instance is used, instead of the top intstane.
- Improved printing the clocks from the trace file with trace-cmd dump command
- Fixed bugs, addressed Steven's comments.

v3 changes:
- Split logically the changes in more patches.
- Extended the TRACECLOCK option with trace clocks.
- Fixed the TRACEID option to expect at least 8 bytes, so it can be extended in the future without breaking the old logic.
- Code cleanup and coding style fixes.
v2 changes:
- Added new trace clock "-C tsc2nsec", which does not depend on host-guest tracing use case.
- A few minor improvements and fixes.

Tzvetomir Stoyanov (VMware) (23):
trace-cmd: Add initial perf interface in trace-cmd library
trace-cmd: Extend trace-cmd dump subcommand to display the clock
trace-cmd: Save only the selected clock in the trace.dat file
trace-cmd: Internal refactoring, move logic for local tep handler in
its own function
trace-cmd: Add new local function to check if a trace clock is
supported
trace-cmd: Add new trace-cmd clock tsc2nsec
trace-cmd: Define a new option for tsc2nsec conversion
trace-cmd: Save information for tsc to nanoseconds conversion in trace
file
trace-cmd: Read information for tsc to nanoseconds conversion from
trace file
trace-cmd: Save tsc2nsec clock in trace.dat file
trace-cmd: Append new options into guest trace file at the end of the
tracing session
trace-cmd: Remove unneeded multiply in events timestamp reading
trace-cmd: Perform all timestamp corrections in a single function
trace-cmd: Convert tsc timestamps to nanosecods when reading trace
data from a file
trace-cmd: Set order and priorities when applying timestamp
corrections
trace-cmd: Add a new flag to disable any timestamp corrections
trace-cmd: Change "--nodate" option to affect "--date" option only
trace-cmd: Add new parameter "--raw-ts" to "trace-cmd report" command
trace-cmd: Print times in TimeShift options as unsigned in trace-cmd
dump
trace-cmd: Use tsc clock for host-guest tracing, if available
trace-cmd: Get current clock for host-guest tracing session
trace-cmd: Save the trace clocks in TRACECLOCK option
trace-cmd: Read at least 8 bytes trace-id option

 Documentation/trace-cmd/trace-cmd-dump.1.txt  |   2 +
 Makefile                                      |   6 +
 lib/trace-cmd/Makefile                        |   3 +
 .../include/private/trace-cmd-private.h       |  22 +
 lib/trace-cmd/trace-input.c                   | 103 +++--
 lib/trace-cmd/trace-output.c                  |  66 ++-
 lib/trace-cmd/trace-perf.c                    | 105 +++++
 lib/trace-cmd/trace-timesync.c                |   1 -
 tracecmd/include/trace-local.h                |   7 +
 tracecmd/trace-dump.c                         |  57 ++-
 tracecmd/trace-read.c                         |   9 +-
 tracecmd/trace-record.c                       | 401 +++++++++++++++---
 tracecmd/trace-usage.c                        |   1 +
 13 files changed, 678 insertions(+), 105 deletions(-)
 create mode 100644 lib/trace-cmd/trace-perf.c
Signature · 1 line
2.30.2