blob: feec1c26992247ca86d05c527c5841d0790c21f1 [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2010-2015. All rights reserved.
Jon Medhurst15ce78d2014-04-10 09:02:02 +01003 *
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
21class Sender;
22
23class PerfSource : public Source {
24public:
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
35private:
Jon Medhurst96b56152014-10-30 18:01:15 +000036 bool handleUEvent(const uint64_t currTime);
Jon Medhurst15ce78d2014-04-10 09:02:02 +010037
38 Buffer mSummary;
Jon Medhurstb1d07442015-05-08 12:04:18 +010039 Buffer *mBuffer;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010040 PerfBuffer mCountersBuf;
41 PerfGroup mCountersGroup;
Jon Medhurst15ce78d2014-04-10 09:02:02 +010042 Monitor mMonitor;
43 UEvent mUEvent;
44 sem_t *const mSenderSem;
45 sem_t *const mStartProfile;
46 int mInterruptFd;
47 bool mIsDone;
48
49 // Intentionally undefined
50 PerfSource(const PerfSource &);
51 PerfSource &operator=(const PerfSource &);
52};
53
54#endif // PERFSOURCE_H