Annotation of OSKit-Mach/kern/pc_sample.h, revision 1.1.1.1

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