perf session: Fix accounting of ordered samples queue
authorJiri Olsa <jolsa@kernel.org>
Sun, 20 Jul 2014 21:55:45 +0000 (23:55 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 24 Jul 2014 19:40:47 +0000 (16:40 -0300)
Properly account flushed samples within the ordered samples queue.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1405893363-21967-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/session.c

index fab5838c06be3e796bdd71d733f2dacc7844135a..88dfef70c13dbeb4ae75635e35762da5b19a974d 100644 (file)
@@ -509,6 +509,7 @@ static int flush_sample_queue(struct perf_session *s,
                os->last_flush = iter->timestamp;
                list_del(&iter->list);
                list_add(&iter->list, &os->sample_cache);
+               os->nr_samples--;
 
                if (show_progress)
                        ui_progress__update(&prog, 1);
@@ -521,8 +522,6 @@ static int flush_sample_queue(struct perf_session *s,
                        list_entry(head->prev, struct sample_queue, list);
        }
 
-       os->nr_samples = 0;
-
        return 0;
 }