Annotation of Gnu-Mach/kern/pc_sample.h, revision 1.1.1.3

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:  * Revision 1.1.1.1  1997/02/25 21:28:25  thomas
                     29:  * Initial source
                     30:  *
                     31:  * Revision 1.1.1.1  1996/10/30 01:38:13  thomas
                     32:  * Imported from UK22
                     33:  *
                     34:  * Revision 1.1  1994/11/02  02:24:15  law
                     35:  * Initial revision
                     36:  *
                     37:  * Revision 2.2  93/11/17  19:06:01  dbg
                     38:  *     Moved kernel internal definitions here from mach/pc_sample.h.
                     39:  *     [93/09/24            dbg]
                     40:  * 
                     41:  */
                     42: 
                     43: /*
                     44:  *     Kernel definitions for PC sampling.
                     45:  */
                     46: #ifndef        _KERN_PC_SAMPLE_H_
                     47: #define        _KERN_PC_SAMPLE_H_
                     48: 
                     49: #include <mach/pc_sample.h>
                     50: #include <mach/machine/vm_types.h>
                     51: #include <kern/kern_types.h>
1.1.1.3 ! root       52: #include <kern/macros.h>
1.1       root       53: 
                     54: /*
                     55:  *     Control structure for sampling, included in
                     56:  *     threads and tasks.  If sampletypes is 0, no
                     57:  *     sampling is done.
                     58:  */
                     59: 
                     60: struct sample_control {
                     61:     vm_offset_t                buffer;
                     62:     unsigned int       seqno;
                     63:     sampled_pc_flavor_t sampletypes;
                     64: };
                     65: 
                     66: typedef struct sample_control  sample_control_t;
                     67: 
                     68: /*
                     69:  *     Routines to take PC samples.
                     70:  */
                     71: extern void take_pc_sample(
                     72:        thread_t        thread,
                     73:        sample_control_t *cp,
                     74:        sampled_pc_flavor_t flavor);
                     75: 
                     76: /*
                     77:  *     Macro to do quick flavor check for sampling,
                     78:  *     on both threads and tasks.
                     79:  */
                     80: #define        take_pc_sample_macro(thread, flavor) \
                     81:     MACRO_BEGIN \
                     82:        task_t  task; \
                     83:  \
                     84:        if ((thread)->pc_sample.sampletypes & (flavor)) \
                     85:            take_pc_sample((thread), &(thread)->pc_sample, (flavor)); \
                     86:  \
                     87:        task = (thread)->task; \
                     88:        if (task->pc_sample.sampletypes & (flavor)) \
                     89:            take_pc_sample((thread), &task->pc_sample, (flavor)); \
                     90:     MACRO_END
                     91: 
                     92: #endif /* _KERN_PC_SAMPLE_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.