Merge tag 'v3.10.86' into linux-linaro-lsk-v3.10
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / FtraceSource.h
1 /**
2  * Copyright (C) ARM Limited 2010-2015. 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 FTRACESOURCE_H
10 #define FTRACESOURCE_H
11
12 #include <semaphore.h>
13 #include <stdio.h>
14
15 #include "Buffer.h"
16 #include "Source.h"
17
18 class FtraceSource : public Source {
19 public:
20         FtraceSource(sem_t *senderSem);
21         ~FtraceSource();
22
23         bool prepare();
24         void run();
25         void interrupt();
26
27         bool isDone();
28         void write(Sender *sender);
29
30 private:
31         void waitFor(const int bytes);
32
33         FILE *mFtraceFh;
34         Buffer mBuffer;
35         int mTid;
36         int mTracingOn;
37
38         // Intentionally unimplemented
39         FtraceSource(const FtraceSource &);
40         FtraceSource &operator=(const FtraceSource &);
41 };
42
43 #endif // FTRACESOURCE_H