pmcstat.h (169069) | pmcstat.h (174396) |
---|---|
1/*- 2 * Copyright (c) 2005-2007, Joseph Koshy | 1/*- 2 * Copyright (c) 2005-2007, Joseph Koshy |
3 * Copyright (c) 2007 The FreeBSD Foundation |
|
3 * All rights reserved. 4 * | 4 * All rights reserved. 5 * |
6 * Portions of this software were developed by A. Joseph Koshy under 7 * sponsorship from the FreeBSD Foundation and Google, Inc. 8 * |
|
5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. --- 5 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. --- 5 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
26 * $FreeBSD: head/usr.sbin/pmcstat/pmcstat.h 169069 2007-04-27 12:09:31Z jkoshy $ | 30 * $FreeBSD: head/usr.sbin/pmcstat/pmcstat.h 174396 2007-12-07 08:26:21Z jkoshy $ |
27 */ 28 29#ifndef _PMCSTAT_H_ 30#define _PMCSTAT_H_ 31 32#define FLAG_HAS_TARGET 0x00000001 /* process target */ 33#define FLAG_HAS_WAIT_INTERVAL 0x00000002 /* -w secs */ 34#define FLAG_HAS_OUTPUT_LOGFILE 0x00000004 /* -O file or pipe */ 35#define FLAG_HAS_COMMANDLINE 0x00000008 /* command */ 36#define FLAG_HAS_SAMPLING_PMCS 0x00000010 /* -S or -P */ 37#define FLAG_HAS_COUNTING_PMCS 0x00000020 /* -s or -p */ 38#define FLAG_HAS_PROCESS_PMCS 0x00000040 /* -P or -p */ 39#define FLAG_HAS_SYSTEM_PMCS 0x00000080 /* -S or -s */ 40#define FLAG_HAS_PIPE 0x00000100 /* implicit log */ 41#define FLAG_READ_LOGFILE 0x00000200 /* -R file */ 42#define FLAG_DO_GPROF 0x00000400 /* -g */ 43#define FLAG_HAS_SAMPLESDIR 0x00000800 /* -D dir */ 44#define FLAG_HAS_KERNELPATH 0x00001000 /* -k kernel */ 45#define FLAG_DO_PRINT 0x00002000 /* -o */ | 31 */ 32 33#ifndef _PMCSTAT_H_ 34#define _PMCSTAT_H_ 35 36#define FLAG_HAS_TARGET 0x00000001 /* process target */ 37#define FLAG_HAS_WAIT_INTERVAL 0x00000002 /* -w secs */ 38#define FLAG_HAS_OUTPUT_LOGFILE 0x00000004 /* -O file or pipe */ 39#define FLAG_HAS_COMMANDLINE 0x00000008 /* command */ 40#define FLAG_HAS_SAMPLING_PMCS 0x00000010 /* -S or -P */ 41#define FLAG_HAS_COUNTING_PMCS 0x00000020 /* -s or -p */ 42#define FLAG_HAS_PROCESS_PMCS 0x00000040 /* -P or -p */ 43#define FLAG_HAS_SYSTEM_PMCS 0x00000080 /* -S or -s */ 44#define FLAG_HAS_PIPE 0x00000100 /* implicit log */ 45#define FLAG_READ_LOGFILE 0x00000200 /* -R file */ 46#define FLAG_DO_GPROF 0x00000400 /* -g */ 47#define FLAG_HAS_SAMPLESDIR 0x00000800 /* -D dir */ 48#define FLAG_HAS_KERNELPATH 0x00001000 /* -k kernel */ 49#define FLAG_DO_PRINT 0x00002000 /* -o */ |
50#define FLAG_DO_CALLGRAPHS 0x00004000 /* -G */ 51#define FLAG_DO_ANALYSIS 0x00008000 /* -g or -G */ |
|
46 47#define DEFAULT_SAMPLE_COUNT 65536 48#define DEFAULT_WAIT_INTERVAL 5.0 49#define DEFAULT_DISPLAY_HEIGHT 23 50#define DEFAULT_BUFFER_SIZE 4096 | 52 53#define DEFAULT_SAMPLE_COUNT 65536 54#define DEFAULT_WAIT_INTERVAL 5.0 55#define DEFAULT_DISPLAY_HEIGHT 23 56#define DEFAULT_BUFFER_SIZE 4096 |
57#define DEFAULT_CALLGRAPH_DEPTH 4 |
|
51 52#define PRINT_HEADER_PREFIX "# " 53#define READPIPEFD 0 54#define WRITEPIPEFD 1 55#define NPIPEFD 2 56 57#define NSOCKPAIRFD 2 58#define PARENTSOCKET 0 --- 4 unchanged lines hidden (view full) --- 63#define PMCSTAT_DEFAULT_NW_HOST "localhost" 64#define PMCSTAT_DEFAULT_NW_PORT "9000" 65#define PMCSTAT_NHASH 256 66#define PMCSTAT_HASH_MASK 0xFF 67 68#define PMCSTAT_LDD_COMMAND "/usr/bin/ldd" 69 70#define PMCSTAT_PRINT_ENTRY(A,T,...) do { \ | 58 59#define PRINT_HEADER_PREFIX "# " 60#define READPIPEFD 0 61#define WRITEPIPEFD 1 62#define NPIPEFD 2 63 64#define NSOCKPAIRFD 2 65#define PARENTSOCKET 0 --- 4 unchanged lines hidden (view full) --- 70#define PMCSTAT_DEFAULT_NW_HOST "localhost" 71#define PMCSTAT_DEFAULT_NW_PORT "9000" 72#define PMCSTAT_NHASH 256 73#define PMCSTAT_HASH_MASK 0xFF 74 75#define PMCSTAT_LDD_COMMAND "/usr/bin/ldd" 76 77#define PMCSTAT_PRINT_ENTRY(A,T,...) do { \ |
71 fprintf((A)->pa_printfile, "%-8s", T); \ 72 fprintf((A)->pa_printfile, " " __VA_ARGS__); \ 73 fprintf((A)->pa_printfile, "\n"); \ | 78 (void) fprintf((A)->pa_printfile, "%-9s", T); \ 79 (void) fprintf((A)->pa_printfile, " " __VA_ARGS__); \ 80 (void) fprintf((A)->pa_printfile, "\n"); \ |
74 } while (0) 75 76enum pmcstat_state { 77 PMCSTAT_FINISHED = 0, 78 PMCSTAT_EXITING = 1, 79 PMCSTAT_RUNNING = 2 80}; 81 --- 25 unchanged lines hidden (view full) --- 107 int pa_logfd; /* output log file */ 108 char *pa_inputpath; /* path to input log */ 109 char *pa_outputpath; /* path to output log */ 110 void *pa_logparser; /* log file parser */ 111 const char *pa_fsroot; /* FS root where executables reside */ 112 char *pa_kernel; /* pathname of the kernel */ 113 const char *pa_samplesdir; /* directory for profile files */ 114 const char *pa_mapfilename;/* mapfile name */ | 81 } while (0) 82 83enum pmcstat_state { 84 PMCSTAT_FINISHED = 0, 85 PMCSTAT_EXITING = 1, 86 PMCSTAT_RUNNING = 2 87}; 88 --- 25 unchanged lines hidden (view full) --- 114 int pa_logfd; /* output log file */ 115 char *pa_inputpath; /* path to input log */ 116 char *pa_outputpath; /* path to output log */ 117 void *pa_logparser; /* log file parser */ 118 const char *pa_fsroot; /* FS root where executables reside */ 119 char *pa_kernel; /* pathname of the kernel */ 120 const char *pa_samplesdir; /* directory for profile files */ 121 const char *pa_mapfilename;/* mapfile name */ |
122 FILE *pa_graphfile; /* where to send the callgraph */ 123 int pa_graphdepth; /* print depth for callgraphs */ |
|
115 double pa_interval; /* printing interval in seconds */ | 124 double pa_interval; /* printing interval in seconds */ |
125 uint32_t pa_cpumask; /* filter for CPUs analysed */ |
|
116 int pa_argc; 117 char **pa_argv; 118 STAILQ_HEAD(, pmcstat_ev) pa_events; 119 SLIST_HEAD(, pmcstat_target) pa_targets; 120} args; 121 122/* Function prototypes */ 123void pmcstat_attach_pmcs(struct pmcstat_args *_a); --- 20 unchanged lines hidden --- | 126 int pa_argc; 127 char **pa_argv; 128 STAILQ_HEAD(, pmcstat_ev) pa_events; 129 SLIST_HEAD(, pmcstat_target) pa_targets; 130} args; 131 132/* Function prototypes */ 133void pmcstat_attach_pmcs(struct pmcstat_args *_a); --- 20 unchanged lines hidden --- |