Seastar
High performance C++ framework for concurrent servers
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
y
Functions
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
y
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Typedefs
Enumerations
Related Functions
Files
File List
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
seastar
testing
linux_perf_event.hh
1
/*
2
* Copyright (C) 2021-present ScyllaDB
3
*/
4
5
/*
6
* This file is open source software, licensed to you under the terms
7
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
8
* distributed with this work for additional information regarding copyright
9
* ownership. You may not use this file except in compliance with the License.
10
*
11
* You may obtain a copy of the License at
12
*
13
* http://www.apache.org/licenses/LICENSE-2.0
14
*
15
* Unless required by applicable law or agreed to in writing,
16
* software distributed under the License is distributed on an
17
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
* KIND, either express or implied. See the License for the
19
* specific language governing permissions and limitations
20
* under the License.
21
*/
22
23
/*
24
* This file was copied from Scylla (https://github.com/scylladb/scylla)
25
*/
26
27
#pragma once
28
29
30
#include <cstdint>
31
#include <utility>
32
#include <unistd.h>
33
34
struct
perf_event_attr;
// from <linux/perf_event.h>
35
36
class
linux_perf_event
{
37
int
_fd = -1;
38
public
:
39
linux_perf_event
(
const
struct ::perf_event_attr& attr, pid_t pid,
int
cpu,
int
group_fd,
unsigned
long
flags);
40
linux_perf_event
(
linux_perf_event
&& x) noexcept : _fd(std::exchange(x._fd, -1)) {}
41
linux_perf_event
& operator=(
linux_perf_event
&& x)
noexcept
;
42
~linux_perf_event
();
43
uint64_t read();
44
void
enable();
45
void
disable();
46
public
:
47
static
linux_perf_event
user_instructions_retired();
48
static
linux_perf_event
user_cpu_cycles_retired();
49
};
50
linux_perf_event
Definition:
linux_perf_event.hh:36
Generated by
1.9.4