test/trace: fix race on collected perf data
authorFeifei Wang <feifei.wang2@arm.com>
Wed, 10 Mar 2021 02:15:27 +0000 (10:15 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 14 Apr 2021 14:12:44 +0000 (16:12 +0200)
commitdda66e716c0550ee8b218428a6d2129bd9c97740
tree6c926a16c454e366762e3ba47fc6da2e8ff1923a
parentace2f054ed43f249514c9ac50da67acf3e834d97
test/trace: fix race on collected perf data

The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c9f ("test/trace: add performance test cases")
Cc: stable@dpdk.org
Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
app/test/test_trace_perf.c