summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2005-06-30 19:01:26 +0000
committerjkoshy <jkoshy@FreeBSD.org>2005-06-30 19:01:26 +0000
commit3cade8d074f10ed4002c26e30494d70bb274b767 (patch)
tree65d154e0d10e4dfd78924cb57c52e53ed80a41dd /sys/kern/kern_exec.c
parentca20bf4b48c565fd16ea813e7cce4e94862c31aa (diff)
downloadFreeBSD-src-3cade8d074f10ed4002c26e30494d70bb274b767.zip
FreeBSD-src-3cade8d074f10ed4002c26e30494d70bb274b767.tar.gz
MFP4:
- pmcstat(8) gprof output mode fixes: lib/libpmc/pmclog.{c,h}, sys/sys/pmclog.h: + Add a 'is_usermode' field to the PMCLOG_PCSAMPLE event + Add an 'entryaddr' field to the PMCLOG_PROCEXEC event, so that pmcstat(8) can determine where the runtime loader /libexec/ld-elf.so.1 is getting loaded. sys/kern/kern_exec.c: + Use a local struct to group the entry address of the image being exec()'ed and the process credential changed flag to the exec handling hook inside hwpmc(4). usr.sbin/pmcstat/*: + Support "-k kernelpath", "-D sampledir". + Implement the ELF bits of 'gmon.out' profile generation in a new file "pmcstat_log.c". Move all log related functions to this file. + Move local definitions and prototypes to "pmcstat.h" - Other bug fixes: + lib/libpmc/pmclog.c: correctly handle EOF in pmclog_read(). + sys/dev/hwpmc_mod.c: unconditionally log a PROCEXIT event to all attached PMCs when a process exits. + sys/sys/pmc.h: correct a function prototype. + Improve usage checks in pmcstat(8). Approved by: re (blanket hwpmc)
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 3640180..719f5bb 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -301,6 +301,9 @@ do_execve(td, args, mac_p)
struct label *interplabel = NULL;
int will_transition;
#endif
+#ifdef HWPMC_HOOKS
+ struct pmckern_procexec pe;
+#endif
vfslocked = 0;
imgp = &image_params;
@@ -681,8 +684,10 @@ interpret:
*/
if (PMC_SYSTEM_SAMPLING_ACTIVE() || PMC_PROC_IS_USING_PMCS(p)) {
PROC_UNLOCK(p);
- PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC,
- (void *) &credential_changing);
+ pe.pm_credentialschanged = credential_changing;
+ pe.pm_entryaddr = imgp->entry_addr;
+
+ PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe);
} else
PROC_UNLOCK(p);
#else /* !HWPMC_HOOKS */
OpenPOWER on IntegriCloud