This is an archive of the discontinued LLVM Phabricator instance.

[trace][intel pt] Add a nice parser for the trace size
ClosedPublic

Authored by wallace on Jul 12 2022, 6:19 PM.

Details

Summary

Thanks to rnofenko@fb.com for coming up with these changes.

This diff adds support for passing units in the trace size inputs. For example,
it's now possible to specify 64KB as the trace size, instead of the
problematic 65536. This makes the user experience a bit friendlier.

As an example, I was able to trace a program with the following command

process trace start -s 64Kb

and then I saw this printed in the trace information

thread trace dump info                                                   

thread #1: tid = 469643
  Total number of trace items: 179982

  Memory usage:
    Raw trace size: 64 KiB

Diff Detail

Event Timeline

wallace created this revision.Jul 12 2022, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 6:19 PM
wallace requested review of this revision.Jul 12 2022, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 6:19 PM
wallace edited the summary of this revision. (Show Details)Jul 12 2022, 6:32 PM
jj10306 accepted this revision.Jul 13 2022, 8:54 AM
jj10306 added inline comments.
lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
174

nit

175–181

nit: this may be overkill but consider using constants here

This revision is now accepted and ready to land.Jul 13 2022, 8:54 AM