File: dt_peb.h

package info (click to toggle)
dtrace 2.0.5-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 24,408 kB
  • sloc: ansic: 61,247; sh: 17,997; asm: 1,717; lex: 947; awk: 754; yacc: 695; perl: 37; sed: 17; makefile: 15
file content (52 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Oracle Linux DTrace.
 * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */

#ifndef	_DT_PEB_H
#define	_DT_PEB_H

#include <stddef.h>
#include <stdint.h>

#include <dt_impl.h>

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Perf event buffer.
 */
typedef struct dt_peb {
	dtrace_hdl_t	*dtp;		/* pointer to containing dtrace_hdl */
	int		cpu;		/* ID of CPU that uses this buffer */
	int		fd;		/* fd of perf output buffer */
	char		*base;		/* address of buffer */
	char		*endp;		/* address of end of buffer */
	uint64_t	last_head;	/* last known head, for peeking */
} dt_peb_t;

/*
 * Set of perf event buffers.  This structure stores buffer information that is
 * shared between all buffers, a shared chunk of memory to copy any event that
 * spans the ring buffer boundary, and an array of perf event buffers.
 */
typedef struct dt_pebset {
	size_t		page_size;	/* size of each page in buffer */
	size_t		data_size;	/* total buffer size */
	struct dt_peb	*pebs;		/* array of perf event buffers */
	char		*tmp;		/* temporary event buffer */
	size_t		tmp_len;	/* length of temporary event buffer */
} dt_pebset_t;

extern void dt_pebs_exit(dtrace_hdl_t *);
extern int dt_pebs_init(dtrace_hdl_t *, size_t);

#ifdef	__cplusplus
}
#endif

#endif	/* _DT_PEB_H */