diff options
Diffstat (limited to 'simpleperf/SampleDisplayer.h')
-rw-r--r-- | simpleperf/SampleDisplayer.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/simpleperf/SampleDisplayer.h b/simpleperf/SampleDisplayer.h index 4317582a..2dde02eb 100644 --- a/simpleperf/SampleDisplayer.h +++ b/simpleperf/SampleDisplayer.h @@ -106,13 +106,21 @@ class CallgraphDisplayer { public: CallgraphDisplayer(uint32_t max_stack = UINT32_MAX, - double percent_limit = 0.0) - : max_stack_(max_stack), percent_limit_(percent_limit) {} + double percent_limit = 0.0, + bool brief_callgraph = false) + : max_stack_(max_stack), percent_limit_(percent_limit), brief_callgraph_(brief_callgraph) {} virtual ~CallgraphDisplayer() {} void operator()(FILE* fp, const SampleT* sample) { + if (sample->callchain.children.empty()) { + return; + } std::string prefix = " "; + if (brief_callgraph_ && sample->callchain.duplicated) { + fprintf(fp, "%s[skipped in brief callgraph mode]\n", prefix.c_str()); + return; + } fprintf(fp, "%s|\n", prefix.c_str()); fprintf(fp, "%s-- %s\n", prefix.c_str(), PrintSampleName(sample).c_str()); prefix.append(3, ' '); @@ -169,6 +177,7 @@ class CallgraphDisplayer { private: uint32_t max_stack_; double percent_limit_; + bool brief_callgraph_; }; // SampleDisplayer is a class using a collections of display functions to show a |