Re: [PATCH v2] perf top: expand the range of multithreaded phase

From: Wenyu Liu(D)
Date: Sun Apr 09 2023 - 23:38:18 EST


Hello,I think Namhyung means only make it multi-threaded unconditionally after the synthesize

a patch like this:

---
tools/perf/builtin-top.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index d4b5b02bab73..60d00975b881 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1273,8 +1273,7 @@ static int __cmd_top(struct perf_top *top)
top->evlist->core.threads, true, false,
top->nr_threads_synthesize);

- if (top->nr_threads_synthesize > 1)
- perf_set_singlethreaded();
+ perf_set_multithreaded();

if (perf_hpp_list.socket) {
ret = perf_env__read_cpu_topology_map(&perf_env);
--

Right?

Thanks,
Wenyu

在 2023/4/10 10:58, Hangliang Lai 写道:
> Thanks for your reply Kim ,
>
>
>
> On 2023-04-07 21:21 you wrote:
>
>
>
>> Not always, the synthesis can run in a single thread.
>
>
>
> But I think in machine__synthesize_threads, there are thread_nr threads will be created to do synthesize_threads_worker(tools/perf/util/synthetic-events.c:970)
>
>
>
> It’s not a single thread part. So we're supposed to call perf_set_multithreaded() before synthesize?
>
>
>
> Thanks,
>
> Hangliang Lai
>
>
>