RemoteDrawingEngine: Reduce RP_READ_BITMAP result timeout.
[haiku.git] / src / bin / debug / profile / CallgrindProfileResult.h
blob1407d0c82ea6b174c3753c1ef0f17eebfcde423c
1 /*
2 * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef CALLGRIND_PROFILE_RESULT_H
6 #define CALLGRIND_PROFILE_RESULT_H
9 #include <stdio.h>
11 #include "ProfileResult.h"
14 class CallgrindImageProfileResult;
17 struct CallgrindCalledFunction {
18 CallgrindCalledFunction* next;
19 CallgrindImageProfileResult* image;
20 int32 function;
21 int64 hits;
23 CallgrindCalledFunction(CallgrindImageProfileResult* image, int32 function)
25 next(NULL),
26 image(image),
27 function(function),
28 hits(0)
34 struct CallgrindFunction {
35 int64 hits;
36 CallgrindCalledFunction* calledFunctions;
37 int32 outputIndex;
38 // index when generating the output file
42 class CallgrindImageProfileResult : public ImageProfileResult,
43 public DoublyLinkedListLinkImpl<CallgrindImageProfileResult> {
44 public:
45 CallgrindImageProfileResult(SharedImage* image,
46 image_id id);
47 virtual ~CallgrindImageProfileResult();
49 status_t Init();
51 inline void AddSymbolHit(int32 symbolIndex,
52 CallgrindImageProfileResult* calledImage,
53 int32 calledSymbol);
55 inline CallgrindFunction* Functions() const;
57 inline int32 OutputIndex() const;
58 inline void SetOutputIndex(int32 index);
60 private:
61 CallgrindFunction* fFunctions;
62 int32 fOutputIndex;
66 class CallgrindProfileResult : public ProfileResult {
67 public:
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,
78 image_id id,
79 ImageProfileResult*& _imageResult);
81 private:
82 void _PrintFunction(FILE* out,
83 CallgrindImageProfileResult* image,
84 int32 functionIndex, bool called);
85 private:
86 int64 fTotalTicks;
87 int64 fUnkownTicks;
88 int64 fDroppedTicks;
89 int32 fNextImageOutputIndex;
90 int32 fNextFunctionOutputIndex;
94 #endif // CALLGRIND_PROFILE_RESULT_H