2 * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef CALLGRIND_PROFILE_RESULT_H
6 #define CALLGRIND_PROFILE_RESULT_H
11 #include "ProfileResult.h"
14 class CallgrindImageProfileResult
;
17 struct CallgrindCalledFunction
{
18 CallgrindCalledFunction
* next
;
19 CallgrindImageProfileResult
* image
;
23 CallgrindCalledFunction(CallgrindImageProfileResult
* image
, int32 function
)
34 struct CallgrindFunction
{
36 CallgrindCalledFunction
* calledFunctions
;
38 // index when generating the output file
42 class CallgrindImageProfileResult
: public ImageProfileResult
,
43 public DoublyLinkedListLinkImpl
<CallgrindImageProfileResult
> {
45 CallgrindImageProfileResult(SharedImage
* image
,
47 virtual ~CallgrindImageProfileResult();
51 inline void AddSymbolHit(int32 symbolIndex
,
52 CallgrindImageProfileResult
* calledImage
,
55 inline CallgrindFunction
* Functions() const;
57 inline int32
OutputIndex() const;
58 inline void SetOutputIndex(int32 index
);
61 CallgrindFunction
* fFunctions
;
66 class CallgrindProfileResult
: public ProfileResult
{
68 CallgrindProfileResult();
70 virtual void AddSamples(
71 ImageProfileResultContainer
* container
,
72 addr_t
* samples
, int32 sampleCount
);
73 virtual void AddDroppedTicks(int32 dropped
);
74 virtual void PrintResults(
75 ImageProfileResultContainer
* container
);
77 virtual status_t
GetImageProfileResult(SharedImage
* image
,
79 ImageProfileResult
*& _imageResult
);
82 void _PrintFunction(FILE* out
,
83 CallgrindImageProfileResult
* image
,
84 int32 functionIndex
, bool called
);
89 int32 fNextImageOutputIndex
;
90 int32 fNextFunctionOutputIndex
;
94 #endif // CALLGRIND_PROFILE_RESULT_H