This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Expose Time Profile utilities for easier reuse
Needs ReviewPublic

Authored by nrj5k on Dec 7 2022, 3:02 PM.

Details

Reviewers
jdoerfert
Summary

In the OpenMP GPU runtime we want to track kernel times and splice them into the time profile of the runtime. To this end we need access to some internals of the Time Profile interface. No functional change intended.

Diff Detail

Event Timeline

nrj5k created this revision.Dec 7 2022, 3:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 3:02 PM
nrj5k requested review of this revision.Dec 7 2022, 3:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 3:02 PM
jdoerfert retitled this revision from Host code to create JSON for Device Time Profile to [NFC] Expose Time Profile utilities for easier reuse.Dec 7 2022, 3:08 PM
jdoerfert edited the summary of this revision. (Show Details)

Let's address these issues first and then we look again.

llvm/include/llvm/Support/TimeProfiler.h
98

llvm::Entry is not a great way to export this.
Rename it, put it into a namespace, or make it part of the TimeTraceProfiler. The last option is probably the nicest.
You also managed to delete the few comments, e.g. for the Entry class, and down below introduces a typo (or reverted a fix for it).

211

This doesn't need to be exposed. That's what the getter is for.