This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][NFCI] Use StringRef.split in launchPerfProcess
ClosedPublic

Authored by Amir on Jun 8 2023, 4:09 PM.

Details

Summary

Use StringRef method instead of reimplementing the splitting.
Incidentally, it also fixes the duplicate printing of the command arguments:

PERF2BOLT: spawning perf job to read branch events
Launching perf: /usr/bin/perf script^@-F^@pid,ip,brstack -F^@pid,ip,brstack pid,ip,brstack -f -i
PERF2BOLT: spawning perf job to read mem events
Launching perf: /usr/bin/perf script^@-F^@pid,event,addr,ip -F^@pid,event,addr,ip pid,event,addr,ip -f -i
PERF2BOLT: spawning perf job to read process events
Launching perf: /usr/bin/perf script^@--show-mmap-events --show-mmap-events -f -i
PERF2BOLT: spawning perf job to read task events
Launching perf: /usr/bin/perf script^@--show-task-events --show-task-events -f -i

Fixes it to:

PERF2BOLT: spawning perf job to read branch events
Launching perf: /usr/bin/perf script -F pid,ip,brstack -f -i
PERF2BOLT: spawning perf job to read mem events
Launching perf: /usr/bin/perf script -F pid,event,addr,ip -f -i
PERF2BOLT: spawning perf job to read process events
Launching perf: /usr/bin/perf script --show-mmap-events -f -i
PERF2BOLT: spawning perf job to read task events
Launching perf: /usr/bin/perf script --show-task-events -f -i

Diff Detail

Event Timeline

Amir created this revision.Jun 8 2023, 4:09 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Amir requested review of this revision.Jun 8 2023, 4:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2023, 4:09 PM
Amir edited the summary of this revision. (Show Details)Jun 8 2023, 4:13 PM
rafauler accepted this revision.Jun 8 2023, 5:17 PM
This revision is now accepted and ready to land.Jun 8 2023, 5:17 PM
This revision was automatically updated to reflect the committed changes.