xref: /aosp_15_r20/external/bcc/examples/cpp/pyperf/PyPerfDefaultPrinter.h (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1*387f9dfdSAndroid Build Coastguard Worker /*
2*387f9dfdSAndroid Build Coastguard Worker  * Copyright (c) Facebook, Inc.
3*387f9dfdSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License")
4*387f9dfdSAndroid Build Coastguard Worker  */
5*387f9dfdSAndroid Build Coastguard Worker 
6*387f9dfdSAndroid Build Coastguard Worker #pragma once
7*387f9dfdSAndroid Build Coastguard Worker 
8*387f9dfdSAndroid Build Coastguard Worker #include "PyPerfSampleProcessor.h"
9*387f9dfdSAndroid Build Coastguard Worker 
10*387f9dfdSAndroid Build Coastguard Worker namespace ebpf {
11*387f9dfdSAndroid Build Coastguard Worker namespace pyperf {
12*387f9dfdSAndroid Build Coastguard Worker 
13*387f9dfdSAndroid Build Coastguard Worker class PyPerfDefaultPrinter : public PyPerfSampleProcessor {
14*387f9dfdSAndroid Build Coastguard Worker  public:
PyPerfDefaultPrinter(bool showGILState,bool showThreadState,bool showPthreadIDState)15*387f9dfdSAndroid Build Coastguard Worker   PyPerfDefaultPrinter(bool showGILState, bool showThreadState,
16*387f9dfdSAndroid Build Coastguard Worker                        bool showPthreadIDState)
17*387f9dfdSAndroid Build Coastguard Worker       : showGILState_(showGILState),
18*387f9dfdSAndroid Build Coastguard Worker         showThreadState_(showThreadState),
19*387f9dfdSAndroid Build Coastguard Worker         showPthreadIDState_(showPthreadIDState) {}
20*387f9dfdSAndroid Build Coastguard Worker 
21*387f9dfdSAndroid Build Coastguard Worker   void processSamples(const std::vector<PyPerfSample>& samples,
22*387f9dfdSAndroid Build Coastguard Worker                       PyPerfUtil* util) override;
23*387f9dfdSAndroid Build Coastguard Worker 
24*387f9dfdSAndroid Build Coastguard Worker  private:
25*387f9dfdSAndroid Build Coastguard Worker   bool showGILState_;
26*387f9dfdSAndroid Build Coastguard Worker   bool showThreadState_;
27*387f9dfdSAndroid Build Coastguard Worker   bool showPthreadIDState_;
28*387f9dfdSAndroid Build Coastguard Worker };
29*387f9dfdSAndroid Build Coastguard Worker 
30*387f9dfdSAndroid Build Coastguard Worker }  // namespace pyperf
31*387f9dfdSAndroid Build Coastguard Worker }  // namespace ebpf
32