From: Steven Rostedt <rostedt@goodmis.org>
To: raistlin.df@gmail.com
Cc: Stefano De Venuto <stefano.devenuto99@gmail.com>,
linux-trace-devel@vger.kernel.org
Subject: Re: [RFC] Open multiple trace files and, if possible, pair them
Date: Fri, 5 Mar 2021 09:47:44 -0500 [thread overview]
Message-ID: <20210305094744.2a8e6a08@gandalf.local.home> (raw)
In-Reply-To: <014e41015f59d4be9a816398302e892897efb244.camel@gmail.com>
On Fri, 05 Mar 2021 10:18:07 +0100
raistlin.df@gmail.com wrote:
> For Stefano: about the patch itself, I think the only thing I'm going
> to say is that some of the lines look a bit long.
>
> I do not see a CODING_STYLE file in the repo, but just looking around,
> I got the impression that we should stay within 76-80 characters all
> the times that it is possible.
Honestly, I'm not a fan of the 80 character limit. I don't want lines that
are 200 characters long either. My windows are normally between 90 and 100
characters wide, so keeping it under 100 is fine with me. Especially if it
keeps the code looking better.
For example:
+ current_trace_id = tracecmd_get_traceid(handles->handle);
+ if (tracecmd_get_guest_cpumap(peer_handle, current_trace_id,
+ NULL, NULL, NULL) != -1)
+ tracecmd_pair_peer(handles->handle, peer_handle);
Should be either:
current_trace_id = tracecmd_get_traceid(handles->handle);
if (tracecmd_get_guest_cpumap(peer_handle, current_trace_id, NULL, NULL, NULL) != -1)
tracecmd_pair_peer(handles->handle, peer_handle);
or:
current_trace_id = tracecmd_get_traceid(handles->handle);
if (tracecmd_get_guest_cpumap(peer_handle, current_trace_id,
NULL, NULL, NULL) != -1) {
tracecmd_pair_peer(handles->handle, peer_handle);
}
Two changes above:
If you break a if conditional up, that categorizes it as a "complex"
statement and brackets should be used. (This is also for Linux kernel
coding style).
The second is, if you break up a function call parameters, the parameters
starting on the next line should line up with the starting parenthesis.
Note, this is not always the case. If the broken line is still long, it is
OK to have the line start before the parenthesis to keep it symmetrical:
current_trace_id = tracecmd_get_traceid(handles->handle);
if (tracecmd_get_guest_cpumap(peer_handle, current_trace_id,
some_string, another_string, bigger_string_as_well) != -1) {
tracecmd_pair_peer(handles->handle, peer_handle);
}
But that too should be avoided if possible.
Thanks!
-- Steve
next prev parent reply other threads:[~2021-03-05 14:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 6:28 [RFC] Open multiple trace files and, if possible, pair them Stefano De Venuto
2021-03-05 9:18 ` raistlin.df
2021-03-05 14:47 ` Steven Rostedt [this message]
2021-03-05 13:50 ` Tzvetomir Stoyanov
2021-03-11 17:37 ` Dario Faggioli
2021-03-11 17:50 ` Steven Rostedt
2021-03-11 17:53 ` Steven Rostedt
2021-03-11 18:32 ` Dario Faggioli
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=20210305094744.2a8e6a08@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=raistlin.df@gmail.com \
--cc=stefano.devenuto99@gmail.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;
as well as URLs for NNTP newsgroup(s).