Merge tag 'v3.10.72' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / PerfSource.h
1 /**
2  * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef PERFSOURCE_H
10 #define PERFSOURCE_H
11
12 #include <semaphore.h>
13
14 #include "Buffer.h"
15 #include "Monitor.h"
16 #include "PerfBuffer.h"
17 #include "PerfGroup.h"
18 #include "Source.h"
19 #include "UEvent.h"
20
21 class Sender;
22
23 class PerfSource : public Source {
24 public:
25         PerfSource(sem_t *senderSem, sem_t *startProfile);
26         ~PerfSource();
27
28         bool prepare();
29         void run();
30         void interrupt();
31
32         bool isDone();
33         void write(Sender *sender);
34
35 private:
36         bool handleUEvent(const uint64_t currTime);
37
38         Buffer mSummary;
39         Buffer mBuffer;
40         PerfBuffer mCountersBuf;
41         PerfGroup mCountersGroup;
42         PerfGroup mIdleGroup;
43         Monitor mMonitor;
44         UEvent mUEvent;
45         sem_t *const mSenderSem;
46         sem_t *const mStartProfile;
47         int mInterruptFd;
48         bool mIsDone;
49
50         // Intentionally undefined
51         PerfSource(const PerfSource &);
52         PerfSource &operator=(const PerfSource &);
53 };
54
55 #endif // PERFSOURCE_H