|
Packit |
577717 |
/****************************/
|
|
Packit |
577717 |
/* THIS IS OPEN SOURCE CODE */
|
|
Packit |
577717 |
/****************************/
|
|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* File: freebsd-libpmc.c
|
|
Packit |
577717 |
* Author: Kevin London
|
|
Packit |
577717 |
* london@cs.utk.edu
|
|
Packit |
577717 |
* Mods: Harald Servat
|
|
Packit |
577717 |
* redcrash@gmail.com
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#ifndef _PAPI_FreeBSD_H
|
|
Packit |
577717 |
#define _PAPI_FreeBSD_H
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <stdio.h>
|
|
Packit |
577717 |
#include <stdlib.h>
|
|
Packit |
577717 |
#include <stdarg.h>
|
|
Packit |
577717 |
#include <sys/types.h>
|
|
Packit |
577717 |
#include <sys/time.h>
|
|
Packit |
577717 |
#include <sys/times.h>
|
|
Packit |
577717 |
#include <unistd.h>
|
|
Packit |
577717 |
#include <string.h>
|
|
Packit |
577717 |
#include <errno.h>
|
|
Packit |
577717 |
#include <assert.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "papi.h"
|
|
Packit |
577717 |
#include <pmc.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "freebsd-config.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define MAX_COUNTERS HWPMC_NUM_COUNTERS
|
|
Packit |
577717 |
#define MAX_COUNTER_TERMS MAX_COUNTERS
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#undef hwd_siginfo_t
|
|
Packit |
577717 |
#undef hwd_register_t
|
|
Packit |
577717 |
#undef hwd_reg_alloc_t
|
|
Packit |
577717 |
#undef hwd_control_state_t
|
|
Packit |
577717 |
#undef hwd_context_t
|
|
Packit |
577717 |
#undef hwd_libpmc_context_t
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_siginfo {
|
|
Packit |
577717 |
int placeholder;
|
|
Packit |
577717 |
} hwd_siginfo_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_register {
|
|
Packit |
577717 |
int placeholder;
|
|
Packit |
577717 |
} hwd_register_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_reg_alloc {
|
|
Packit |
577717 |
int placeholder;
|
|
Packit |
577717 |
} hwd_reg_alloc_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_control_state {
|
|
Packit |
577717 |
int n_counters; /* Number of counters */
|
|
Packit |
577717 |
int hwc_domain; /* HWC domain {user|kernel} */
|
|
Packit |
577717 |
unsigned *caps; /* Capabilities for each counter */
|
|
Packit |
577717 |
pmc_id_t *pmcs; /* PMC identifiers */
|
|
Packit |
577717 |
pmc_value_t *values; /* Stored values for each counter */
|
|
Packit |
577717 |
char **counters; /* Name of each counter (with mode) */
|
|
Packit |
577717 |
} hwd_control_state_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_context {
|
|
Packit |
577717 |
int placeholder;
|
|
Packit |
577717 |
} hwd_context_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "freebsd-context.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
typedef struct hwd_libpmc_context {
|
|
Packit |
577717 |
int CPUtype;
|
|
Packit |
577717 |
int use_rdtsc;
|
|
Packit |
577717 |
} hwd_libpmc_context_t;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#define _papi_hwd_lock_init() { ; }
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#endif /* _PAPI_FreeBSD_H */
|