[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/pmc.h

Version: -  FREEBSD  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  cheribsd  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1  -  FREEBSD-LIBC  -  FREEBSD8-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: pmc.h,v 1.5 2005/12/11 12:25:20 christos Exp $ */
    2 
    3 /*
    4  * Copyright (c) 2002 Wasabi Systems, Inc.
    5  * All rights reserved.
    6  *
    7  * Written by Allen Briggs for Wasabi Systems, Inc.
    8  *
    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.
   17  * 3. All advertising materials mentioning features or use of this software
   18  *    must display the following acknowledgement:
   19  *      This product includes software developed for the NetBSD Project by
   20  *      Wasabi Systems, Inc.
   21  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
   22  *    or promote products derived from this software without specific prior
   23  *    written permission.
   24  *
   25  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
   26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   27  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   28  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
   29  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   33  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   35  * POSSIBILITY OF SUCH DAMAGE.
   36  */
   37 
   38 #ifndef _SYS_PMC_H_
   39 #define _SYS_PMC_H_
   40 
   41 struct pmc_counter_cfg {
   42         pmc_evid_t      event_id;               /* What event to configure */
   43         pmc_ctr_t       reset_value;            /* Value to set counter to */
   44         uint32_t        flags;                  /* PMC_FLAG_* */
   45 };
   46 
   47 #if defined(_KERNEL)
   48 
   49 /*
   50  *      The following functions are defined in machine/pmc.h as either
   51  * functions or macros.
   52  *
   53  * int  pmc_get_num_counters(void);
   54  * int  pmc_get_counter_type(int ctr);
   55  *
   56  * void pmc_save_context(struct proc *p);
   57  * void pmc_restore_context(struct proc *p);
   58  * void pmc_process_exit(struct proc *p);
   59  *
   60  * int  pmc_enable_counter(struct proc *p, int ctr);
   61  * int  pmc_disable_counter(struct proc *p, int ctr);
   62  * int  pmc_counter_isrunning(struct proc *p, int ctr);
   63  * int  pmc_counter_isconfigured(struct proc *p, int ctr);
   64  *
   65  * int  pmc_configure_counter(struct proc *p, int ctr, pmc_counter_cfg *cfg);
   66  *
   67  * int  pmc_get_counter_value(struct proc *p, int ctr, int flags,
   68  *          uint64_t *pval);
   69  *
   70  * int  pmc_accumulate(struct proc *p_parent, struct proc *p_exiting);
   71  *
   72  * int  pmc_alloc_kernel_counter(int ctr, struct pmc_counter_cfg *cfg);
   73  * int  pmc_free_kernel_counter(int ctr);
   74  *
   75  * int  pmc_start_profiling(int ctr, struct pmc_counter_cfg *cfg);
   76  * int  pmc_stop_profiling(int ctr);
   77  *
   78  * int  PMC_ENABLED(struct proc *p);
   79  */
   80 
   81 #define PMC_VALUE_FLAGS_CHILDREN        0x00000001
   82 
   83 #endif  /* _KERNEL */
   84 
   85 #include <machine/pmc.h>
   86 
   87 #define PMC_OP_START            1
   88 #define PMC_OP_STOP             2
   89 #define PMC_OP_CONFIGURE        3
   90 #define PMC_OP_PROFSTART        4
   91 #define PMC_OP_PROFSTOP         5
   92 int     pmc_control(int ctr, int operation, void *args);
   93 
   94 #define PMC_INFO_NCOUNTERS                      1
   95 #define PMC_INFO_CPUCTR_TYPE                    2
   96 #define PMC_INFO_COUNTER_VALUE                  3
   97 #define PMC_INFO_ACCUMULATED_COUNTER_VALUE      4
   98 int     pmc_get_info(int ctr, int request, void *data);
   99 
  100 #endif  /* !_SYS_PMC_H_ */

Cache object: b0a37f5a8e21607775c46d6fad404fc2


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.