diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2018-06-07 02:03:22 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2018-06-07 02:03:22 +0000 |
commit | f992dd4b5c6635e079c572fe1b59e34f0e28ad6d (patch) | |
tree | 6cd98711d1e0c3f928cc01dc292b253f900c79da /sys/sys/pmc.h | |
parent | 1b000b505b84270219bff27d9c627877209f7e56 (diff) | |
download | src-f992dd4b5c6635e079c572fe1b59e34f0e28ad6d.tar.gz src-f992dd4b5c6635e079c572fe1b59e34f0e28ad6d.zip |
pmc: convert native to jsonl and track TSC value of samples
- add '-j' options to filter to enable converting native pmc
log format to json lines format to enable the use of scripts
and external tooling
% pmc filter -j pmc.log pmc.jsonl
- Record the tsc value in sampling interrupts as opposed to
recording nanotime when the sample is copied to a global log
in hardclock - potentially many milliseconds later.
- At initialize record the tsc_freq and the time of day to give
us an offset for translating the tsc values in callchain records
Notes
Notes:
svn path=/head/; revision=334749
Diffstat (limited to 'sys/sys/pmc.h')
-rw-r--r-- | sys/sys/pmc.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index a1e24bc8d47b..428d1f381990 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -61,7 +61,7 @@ * * The patch version is incremented for every bug fix. */ -#define PMC_VERSION_MAJOR 0x07 +#define PMC_VERSION_MAJOR 0x08 #define PMC_VERSION_MINOR 0x03 #define PMC_VERSION_PATCH 0x0000 @@ -939,6 +939,7 @@ struct pmc_sample { struct thread *ps_td; /* which thread */ struct pmc *ps_pmc; /* interrupting PMC */ uintptr_t *ps_pc; /* (const) callchain start */ + uint64_t ps_tsc; /* tsc value */ }; #define PMC_SAMPLE_FREE ((uint16_t) 0) @@ -1217,5 +1218,6 @@ int pmc_save_user_callchain(uintptr_t *_cc, int _maxsamples, struct pmc_mdep *pmc_mdep_alloc(int nclasses); void pmc_mdep_free(struct pmc_mdep *md); void pmc_flush_samples(int cpu); +uint64_t pmc_rdtsc(void); #endif /* _KERNEL */ #endif /* _SYS_PMC_H_ */ |