10b86b1bbSFabien Thomas /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 31de7b4b8SPedro F. Giffuni * 40b86b1bbSFabien Thomas * Copyright (c) 2005-2007, Joseph Koshy 50b86b1bbSFabien Thomas * Copyright (c) 2007 The FreeBSD Foundation 60b86b1bbSFabien Thomas * Copyright (c) 2009, Fabien Thomas 70b86b1bbSFabien Thomas * All rights reserved. 80b86b1bbSFabien Thomas * 90b86b1bbSFabien Thomas * Portions of this software were developed by A. Joseph Koshy under 100b86b1bbSFabien Thomas * sponsorship from the FreeBSD Foundation and Google, Inc. 110b86b1bbSFabien Thomas * 120b86b1bbSFabien Thomas * Redistribution and use in source and binary forms, with or without 130b86b1bbSFabien Thomas * modification, are permitted provided that the following conditions 140b86b1bbSFabien Thomas * are met: 150b86b1bbSFabien Thomas * 1. Redistributions of source code must retain the above copyright 160b86b1bbSFabien Thomas * notice, this list of conditions and the following disclaimer. 170b86b1bbSFabien Thomas * 2. Redistributions in binary form must reproduce the above copyright 180b86b1bbSFabien Thomas * notice, this list of conditions and the following disclaimer in the 190b86b1bbSFabien Thomas * documentation and/or other materials provided with the distribution. 200b86b1bbSFabien Thomas * 210b86b1bbSFabien Thomas * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 220b86b1bbSFabien Thomas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 230b86b1bbSFabien Thomas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 240b86b1bbSFabien Thomas * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 250b86b1bbSFabien Thomas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 260b86b1bbSFabien Thomas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 270b86b1bbSFabien Thomas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 280b86b1bbSFabien Thomas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 290b86b1bbSFabien Thomas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 300b86b1bbSFabien Thomas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 310b86b1bbSFabien Thomas * SUCH DAMAGE. 320b86b1bbSFabien Thomas */ 330b86b1bbSFabien Thomas 340b86b1bbSFabien Thomas #ifndef _PMCSTAT_LOG_H_ 350b86b1bbSFabien Thomas #define _PMCSTAT_LOG_H_ 360b86b1bbSFabien Thomas 37d27927f7SRuslan Bukin #include <libpmcstat.h> 380b86b1bbSFabien Thomas 390b86b1bbSFabien Thomas extern struct pmcstat_stats pmcstat_stats; /* statistics */ 400b86b1bbSFabien Thomas extern struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */ 410b86b1bbSFabien Thomas extern int pmcstat_npmcs; /* PMC count. */ 420b86b1bbSFabien Thomas 430b86b1bbSFabien Thomas /* 440b86b1bbSFabien Thomas * Top mode global options. 450b86b1bbSFabien Thomas */ 46bf70beceSEd Schouten extern float pmcstat_threshold; /* Threshold to filter node. */ 47bf70beceSEd Schouten extern int pmcstat_pmcinfilter; /* PMC index displayed. */ 480b86b1bbSFabien Thomas 490b86b1bbSFabien Thomas /* Function prototypes */ 500b86b1bbSFabien Thomas const char *pmcstat_pmcid_to_name(pmc_id_t _pmcid); 510b86b1bbSFabien Thomas const char *pmcstat_pmcindex_to_name(int pmcin); 520b86b1bbSFabien Thomas struct pmcstat_pmcrecord *pmcstat_pmcindex_to_pmcr(int pmcin); 530b86b1bbSFabien Thomas int pmcstat_image_addr2line(struct pmcstat_image *image, uintfptr_t addr, 540b86b1bbSFabien Thomas char *sourcefile, size_t sourcefile_len, unsigned *sourceline, 550b86b1bbSFabien Thomas char *funcname, size_t funcname_len); 560b86b1bbSFabien Thomas 570b86b1bbSFabien Thomas #endif /* _PMCSTAT_LOG_H_ */ 58