From: nils.carlson@ericsson.com (Nils Carlson)
Subject: [ltt-dev] [UST] open_buffers_list in tracectl.c
Date: Tue, 22 Feb 2011 09:09:28 +0100 [thread overview]
Message-ID: <4D636F38.6010101@ericsson.com> (raw)
In-Reply-To: <4D62C223.3080504@gmail.com>
Yannick Brosseau wrote:
> Question for UST experts (Nils?)
Not an expert, at least in this part of the code... :-) The plan is after
all to replace the buffer handling with mathieus generic buffer library
so I haven't put too much work into it.
>
> While trying to fix the fork case, I've found problems with the the
> open_buffers_list. I've fixed the segfault by moving the
> ltt_trace_destroy later in ust_fork, but now I get some warnings about
> already closed file descriptor.
> It seems that we try to close the fd twice.
> Now I'm wondering if we really need to close the fd referenced by the
> open buffers list in ust_fork()? All these FD are closed when we destroy
> the channels in the call to ltt_trace_destroy, so it seems redundant to
> me.
>
> Am I missing something?
No, this is actually on my "to fix list". The trace name however isn't
guaranteed to be "auto" anymore so we should actually loop over the
existing traces and destroy each of them properly. We have a number
of these "auto" assumptions scattered through tracectrl.c and all of
them should be fixed.
/Nils
>
> For quick reference here's the code using open_buffer_list from
> tracectl.c in ust_fork(void)
>
> /* Delete all blocked consumers */
> cds_list_for_each_entry_safe(buf, buf_tmp, &open_buffers_list,
> open_buffers_list) {
> result = close(buf->data_ready_fd_read);
> if (result == -1) {
> PERROR("close");
> }
> result = close(buf->data_ready_fd_write);
> if (result == -1) {
> PERROR("close");
> }
> cds_list_del(&buf->open_buffers_list);
> }
>
> It would suggest to change it to simply
>
> /* Empty the list of open buffers */
> cds_list_for_each_entry_safe(buf, buf_tmp, &open_buffers_list,
> open_buffers_list) {
> cds_list_del(&buf->open_buffers_list);
> }
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
prev parent reply other threads:[~2011-02-22 8:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 19:50 Yannick Brosseau
2011-02-22 8:09 ` Nils Carlson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D636F38.6010101@ericsson.com \
--to=nils.carlson@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox