[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211116080730.GV174703@worktop.programming.kicks-ass.net>
Date: Tue, 16 Nov 2021 09:07:30 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Yinan Liu <yinan@...ux.alibaba.com>
Cc: rostedt@...dmis.org, mark-pk.tsai@...iatek.com, mingo@...hat.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] scripts: ftrace - move the sort-processing in
ftrace_init to compile time
On Tue, Nov 16, 2021 at 10:49:41AM +0800, Yinan Liu wrote:
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 30bc880c3849..c776a2956237 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -6406,8 +6406,9 @@ static int ftrace_process_locs(struct module *mod,
> if (!count)
> return 0;
>
> - sort(start, count, sizeof(*start),
> - ftrace_cmp_ips, NULL);
> + if (mod)
> + sort(start, count, sizeof(*start),
> + ftrace_cmp_ips, NULL);
>
/me hands a bucket of {} your way. Also, can't sorttable be ran on
modules ?
> @@ -376,5 +466,20 @@ static int do_sort(Elf_Ehdr *ehdr,
> }
> }
> #endif
> + if (mcount_sort_thread) {
> + void *retval = NULL;
> + /* wait for mcount sort done */
> + rc = pthread_join(mcount_sort_thread, &retval);
> + if (rc)
> + fprintf(stderr,
> + "pthread_join failed '%s': %s\n",
> + strerror(errno), fname);
Use some here too :-)
> + else if (retval) {
> + rc = -1;
> + fprintf(stderr,
> + "failed to sort mcount '%s': %s\n",
> + (char *)retval, fname);
> + }
> + }
> return rc;
> }
Powered by blists - more mailing lists