summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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