Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/dev/profile/profile.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
struct profile_probe_percpu; | struct profile_probe_percpu; | ||||
#ifdef __mips | #ifdef __mips | ||||
/* bogus */ | /* bogus */ | ||||
#define PROF_ARTIFICIAL_FRAMES 3 | #define PROF_ARTIFICIAL_FRAMES 3 | ||||
#endif | #endif | ||||
#ifdef __arm__ | #ifdef __arm__ | ||||
/* | #define PROF_ARTIFICIAL_FRAMES 3 | ||||
* At least on ARMv7, this appears to work quite well. | |||||
*/ | |||||
#define PROF_ARTIFICIAL_FRAMES 10 | |||||
#endif | #endif | ||||
#ifdef __aarch64__ | #ifdef __aarch64__ | ||||
/* TODO: verify */ | /* TODO: verify */ | ||||
#define PROF_ARTIFICIAL_FRAMES 10 | #define PROF_ARTIFICIAL_FRAMES 10 | ||||
#endif | #endif | ||||
typedef struct profile_probe { | typedef struct profile_probe { | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
static struct cdev *profile_cdev; | static struct cdev *profile_cdev; | ||||
static dtrace_provider_id_t profile_id; | static dtrace_provider_id_t profile_id; | ||||
static hrtime_t profile_interval_min = NANOSEC / 5000; /* 5000 hz */ | static hrtime_t profile_interval_min = NANOSEC / 5000; /* 5000 hz */ | ||||
static int profile_aframes = 0; /* override */ | static int profile_aframes = 0; /* override */ | ||||
static sbintime_t | static sbintime_t | ||||
nsec_to_sbt(hrtime_t nsec) | nsec_to_sbt(hrtime_t nsec) | ||||
{ | { | ||||
stas: SYSCTL_INT? | |||||
time_t sec; | time_t sec; | ||||
/* | /* | ||||
* We need to calculate nsec * 2^32 / 10^9 | * We need to calculate nsec * 2^32 / 10^9 | ||||
* Seconds and nanoseconds are split to avoid overflow. | * Seconds and nanoseconds are split to avoid overflow. | ||||
*/ | */ | ||||
sec = nsec / NANOSEC; | sec = nsec / NANOSEC; | ||||
nsec = nsec % NANOSEC; | nsec = nsec % NANOSEC; | ||||
▲ Show 20 Lines • Show All 473 Lines • Show Last 20 Lines |
SYSCTL_INT?