Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154623
b: refs/heads/master
c: f344011
h: refs/heads/master
i:
  154621: d24dba3
  154619: 95d1798
  154615: d63d54f
  154607: 77c6737
  154591: 05c9aae
  154559: d66d186
  154495: 2ed8e33
  154367: 07a4023
  154111: 51a4ebf
  153599: 031ff73
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 23, 2009
1 parent f7f1de0 commit 0628d71
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b84fbc9fb1d943e2c5f4efe52ed0e3c93a4bdb6a
refs/heads/master: f344011ccb85469445369153c3d27c4ee4bc2ac8
32 changes: 20 additions & 12 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,11 +1508,13 @@ static void free_counter(struct perf_counter *counter)
{
perf_pending_sync(counter);

atomic_dec(&nr_counters);
if (counter->attr.mmap)
atomic_dec(&nr_mmap_counters);
if (counter->attr.comm)
atomic_dec(&nr_comm_counters);
if (!counter->parent) {
atomic_dec(&nr_counters);
if (counter->attr.mmap)
atomic_dec(&nr_mmap_counters);
if (counter->attr.comm)
atomic_dec(&nr_comm_counters);
}

if (counter->destroy)
counter->destroy(counter);
Expand Down Expand Up @@ -3515,6 +3517,8 @@ static void sw_perf_counter_destroy(struct perf_counter *counter)
{
u64 event = counter->attr.config;

WARN_ON(counter->parent);

atomic_dec(&perf_swcounter_enabled[event]);
}

Expand Down Expand Up @@ -3551,8 +3555,10 @@ static const struct pmu *sw_perf_counter_init(struct perf_counter *counter)
case PERF_COUNT_SW_PAGE_FAULTS_MAJ:
case PERF_COUNT_SW_CONTEXT_SWITCHES:
case PERF_COUNT_SW_CPU_MIGRATIONS:
atomic_inc(&perf_swcounter_enabled[event]);
counter->destroy = sw_perf_counter_destroy;
if (!counter->parent) {
atomic_inc(&perf_swcounter_enabled[event]);
counter->destroy = sw_perf_counter_destroy;
}
pmu = &perf_ops_generic;
break;
}
Expand Down Expand Up @@ -3663,11 +3669,13 @@ perf_counter_alloc(struct perf_counter_attr *attr,

counter->pmu = pmu;

atomic_inc(&nr_counters);
if (counter->attr.mmap)
atomic_inc(&nr_mmap_counters);
if (counter->attr.comm)
atomic_inc(&nr_comm_counters);
if (!counter->parent) {
atomic_inc(&nr_counters);
if (counter->attr.mmap)
atomic_inc(&nr_mmap_counters);
if (counter->attr.comm)
atomic_inc(&nr_comm_counters);
}

return counter;
}
Expand Down

0 comments on commit 0628d71

Please sign in to comment.