|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1993 Carnegie Mellon University
4: * All Rights Reserved.
5: *
6: * Permission to use, copy, modify and distribute this software and its
7: * documentation is hereby granted, provided that both the copyright
8: * notice and this permission notice appear in all copies of the
9: * software, derivative works or modified versions, and any portions
10: * thereof, and that both notices appear in supporting documentation.
11: *
12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15: *
16: * Carnegie Mellon requests users of this software to return to
17: *
18: * Software Distribution Coordinator or [email protected]
19: * School of Computer Science
20: * Carnegie Mellon University
21: * Pittsburgh PA 15213-3890
22: *
23: * any improvements or extensions that they make and grant Carnegie Mellon
24: * the rights to redistribute these changes.
25: */
26: /*
27: * HISTORY
28: * $Log: pc_sample.h,v $
29: * Revision 1.1.1.1 1997/02/25 21:28:25 thomas
30: * Initial source
31: *
32: * Revision 1.1.1.1 1996/10/30 01:38:13 thomas
33: * Imported from UK22
34: *
35: * Revision 1.1 1994/11/02 02:24:15 law
36: * Initial revision
37: *
38: * Revision 2.2 93/11/17 19:06:01 dbg
39: * Moved kernel internal definitions here from mach/pc_sample.h.
40: * [93/09/24 dbg]
41: *
42: */
43:
44: /*
45: * Kernel definitions for PC sampling.
46: */
47: #ifndef _KERN_PC_SAMPLE_H_
48: #define _KERN_PC_SAMPLE_H_
49:
50: #include <mach/pc_sample.h>
51: #include <mach/machine/vm_types.h>
52: #include <kern/kern_types.h>
53: #include <kern/macro_help.h>
54:
55: /*
56: * Control structure for sampling, included in
57: * threads and tasks. If sampletypes is 0, no
58: * sampling is done.
59: */
60:
61: struct sample_control {
62: vm_offset_t buffer;
63: unsigned int seqno;
64: sampled_pc_flavor_t sampletypes;
65: };
66:
67: typedef struct sample_control sample_control_t;
68:
69: /*
70: * Routines to take PC samples.
71: */
72: extern void take_pc_sample(
73: thread_t thread,
74: sample_control_t *cp,
75: sampled_pc_flavor_t flavor);
76:
77: /*
78: * Macro to do quick flavor check for sampling,
79: * on both threads and tasks.
80: */
81: #define take_pc_sample_macro(thread, flavor) \
82: MACRO_BEGIN \
83: task_t task; \
84: \
85: if ((thread)->pc_sample.sampletypes & (flavor)) \
86: take_pc_sample((thread), &(thread)->pc_sample, (flavor)); \
87: \
88: task = (thread)->task; \
89: if (task->pc_sample.sampletypes & (flavor)) \
90: take_pc_sample((thread), &task->pc_sample, (flavor)); \
91: MACRO_END
92:
93: #endif /* _KERN_PC_SAMPLE_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.