libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
prctl.hxx
1#pragma once
2
3// clues
4#include <clues/arch.hxx>
5#include <clues/items/items.hxx>
6
7// Linux
8#ifdef CLUES_HAVE_ARCH_PRCTL
9#include <asm/prctl.h>
10#endif
11
12
13namespace clues::item {
14
15#ifdef CLUES_HAVE_ARCH_PRCTL
17class CLUES_API ArchOpParameter :
18 public ValueInParameter {
19public: // types
20
21 enum class Operation : int {
22 SET_CPUID = ARCH_SET_CPUID,
23 GET_CPUID = ARCH_GET_CPUID,
24 SET_FS = ARCH_SET_FS,
25 GET_FS = ARCH_GET_FS,
26 SET_GS = ARCH_SET_GS,
27 GET_GS = ARCH_GET_GS
28 };
29
30public: // functions
31
32 explicit ArchOpParameter() :
33 ValueInParameter{"op"} {
34 }
35
36 std::string str() const override;
37
38 Operation operation() const {
39 return m_op;
40 }
41
42protected: // functions
43
44 void processValue(const Tracee &) override {
45 m_op = Operation{valueAs<int>()};
46 }
47
48protected: // data
49
50 Operation m_op = Operation{0};
51};
52#endif
53
54} // end ns
Specialization of ValueParameter for PARAM_IN parameters.
Definition items.hxx:47