13554f22eSMatt Macy /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 33554f22eSMatt Macy * 43554f22eSMatt Macy * Copyright (c) 2018, Matthew Macy 53554f22eSMatt Macy * 63554f22eSMatt Macy * Redistribution and use in source and binary forms, with or without 73554f22eSMatt Macy * modification, are permitted provided that the following conditions 83554f22eSMatt Macy * are met: 93554f22eSMatt Macy * 1. Redistributions of source code must retain the above copyright 103554f22eSMatt Macy * notice, this list of conditions and the following disclaimer. 113554f22eSMatt Macy * 2. Redistributions in binary form must reproduce the above copyright 123554f22eSMatt Macy * notice, this list of conditions and the following disclaimer in the 133554f22eSMatt Macy * documentation and/or other materials provided with the distribution. 143554f22eSMatt Macy * 153554f22eSMatt Macy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 163554f22eSMatt Macy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 173554f22eSMatt Macy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 183554f22eSMatt Macy * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 193554f22eSMatt Macy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 203554f22eSMatt Macy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 213554f22eSMatt Macy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 223554f22eSMatt Macy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 233554f22eSMatt Macy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 243554f22eSMatt Macy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 253554f22eSMatt Macy * SUCH DAMAGE. 263554f22eSMatt Macy * 273554f22eSMatt Macy */ 283554f22eSMatt Macy #ifndef _CMD_PMC_H_ 293554f22eSMatt Macy #define _CMD_PMC_H_ 303554f22eSMatt Macy 313554f22eSMatt Macy #define DEFAULT_DISPLAY_HEIGHT 256 /* file virtual height */ 323554f22eSMatt Macy #define DEFAULT_DISPLAY_WIDTH 1024 /* file virtual width */ 333554f22eSMatt Macy 343554f22eSMatt Macy extern int pmc_displayheight; 353554f22eSMatt Macy extern int pmc_displaywidth; 363554f22eSMatt Macy extern int pmc_kq; 373554f22eSMatt Macy extern struct pmcstat_args pmc_args; 383554f22eSMatt Macy 393554f22eSMatt Macy typedef int (*cmd_disp_t)(int, char **); 403554f22eSMatt Macy 41ebfaf69cSMatt Macy #if defined(__cplusplus) 42ebfaf69cSMatt Macy extern "C" { 43ebfaf69cSMatt Macy #endif 443554f22eSMatt Macy int cmd_pmc_stat(int, char **); 45bfb46e2bSMatt Macy int cmd_pmc_filter(int, char **); 463554f22eSMatt Macy int cmd_pmc_stat_system(int, char **); 47c8d23c13SMatt Macy int cmd_pmc_list_events(int, char **); 48b2ca2e50SMatt Macy int cmd_pmc_summary(int, char **); 49ebfaf69cSMatt Macy #if defined(__cplusplus) 50ebfaf69cSMatt Macy }; 51ebfaf69cSMatt Macy #endif 523554f22eSMatt Macy int pmc_util_get_pid(struct pmcstat_args *); 533554f22eSMatt Macy void pmc_util_start_pmcs(struct pmcstat_args *); 543554f22eSMatt Macy void pmc_util_cleanup(struct pmcstat_args *); 553554f22eSMatt Macy void pmc_util_shutdown_logging(struct pmcstat_args *args); 563554f22eSMatt Macy void pmc_util_kill_process(struct pmcstat_args *args); 573554f22eSMatt Macy 583554f22eSMatt Macy #endif 59