All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible overwriting of errno
@ 2022-06-29  5:31 Emil Berg
  2022-06-29  9:44 ` Jiri Olsa
  2022-10-11  8:04 ` Emil Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Emil Berg @ 2022-06-29  5:31 UTC (permalink / raw)
  To: linux-perf-users

Hi!

I'm getting the error "Failed to start threads: File exists" from perf, probably EEXIST.

I just want to discuss the changes to tools/perf/builtin-record.c made Feb 10 2022 with:
perf record: Start threads in the beginning of trace streaming
SHA: 3217e9fecf118d5dcabdd68d91e0c6afcb4c3e1b

At line 2014 pthread_create() is run and on line 2017 strerror(errno) is printed. Between line 2014 and 2017 record__terminate_thread() is run.

I just think record__terminate_thread() run in-between looks like it may overwrite errno, thus messing up the error message. To be clear I think the error message should come from failure of thread creation and not from failure of thread termination. Can someone enlighten me here?

if (pthread_create(&handle, &attrs, record__thread, &thread_data[t])) {
    for (tt = 1; tt < t; tt++)
        record__terminate_thread(&thread_data[t]);
    pr_err("Failed to start threads: %s\n", strerror(errno));

/Emil Berg

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-11  8:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29  5:31 Possible overwriting of errno Emil Berg
2022-06-29  9:44 ` Jiri Olsa
2022-06-29 12:50   ` Emil Berg
2022-10-11  8:04 ` Emil Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.