summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat/pmcstat_log.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2011-11-15 06:50:10 +0000
committerobrien <obrien@FreeBSD.org>2011-11-15 06:50:10 +0000
commit07a4da4c91ffd21b05a873def33903aabb77f9e4 (patch)
treef529dc7a87b10fd1235f71eff06605ebb4e5badd /usr.sbin/pmcstat/pmcstat_log.c
parent645c15928a6a22d853a33666471d09218dd355ca (diff)
downloadFreeBSD-src-07a4da4c91ffd21b05a873def33903aabb77f9e4.zip
FreeBSD-src-07a4da4c91ffd21b05a873def33903aabb77f9e4.tar.gz
KNF
Diffstat (limited to 'usr.sbin/pmcstat/pmcstat_log.c')
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c
index 13db169..6c0eb14 100644
--- a/usr.sbin/pmcstat/pmcstat_log.c
+++ b/usr.sbin/pmcstat/pmcstat_log.c
@@ -1218,22 +1218,23 @@ pmcstat_process_lookup(pid_t pid, int allocate)
hash = (uint32_t) pid & PMCSTAT_HASH_MASK; /* simplicity wins */
LIST_FOREACH_SAFE(pp, &pmcstat_process_hash[hash], pp_next, pptmp)
- if (pp->pp_pid == pid) {
- /* Found a descriptor, check and process zombies */
- if (allocate && pp->pp_isactive == 0) {
- /* remove maps */
- TAILQ_FOREACH_SAFE(ppm, &pp->pp_map, ppm_next,
- ppmtmp) {
- TAILQ_REMOVE(&pp->pp_map, ppm, ppm_next);
- free(ppm);
- }
- /* remove process entry */
- LIST_REMOVE(pp, pp_next);
- free(pp);
- break;
- }
- return (pp);
- }
+ if (pp->pp_pid == pid) {
+ /* Found a descriptor, check and process zombies */
+ if (allocate && pp->pp_isactive == 0) {
+ /* remove maps */
+ TAILQ_FOREACH_SAFE(ppm, &pp->pp_map, ppm_next,
+ ppmtmp) {
+ TAILQ_REMOVE(&pp->pp_map, ppm,
+ ppm_next);
+ free(ppm);
+ }
+ /* remove process entry */
+ LIST_REMOVE(pp, pp_next);
+ free(pp);
+ break;
+ }
+ return (pp);
+ }
if (!allocate)
return (NULL);
OpenPOWER on IntegriCloud