<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Guys, JFYI, we are getting rid of LOG_NONL and indent in logger as non multi-thread safe (we are moving towards multi threaded eventloop):
<div class=""><a href="https://git.acronis.com/projects/STRG/repos/pstorage-core/pull-requests/765/diff" class="">https://git.acronis.com/projects/STRG/repos/pstorage-core/pull-requests/765/diff</a></div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Dec 2018, at 12:29, Pavel Butsykin <<a href="mailto:pbutsykin@virtuozzo.com" class="">pbutsykin@virtuozzo.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On 04.12.2018 23:13, Pavel Emelianov wrote:<br class="">
<blockquote type="cite" class="">On 12/04/2018 10:28 PM, Pavel Emelyanov wrote:<br class="">
<blockquote type="cite" class="">On 12/03/2018 05:20 PM, Pavel Butsykin wrote:<br class="">
<blockquote type="cite" class="">On 30.11.2018 19:44, Pavel Emelianov wrote:<br class="">
<blockquote type="cite" class="">On 11/30/2018 05:57 PM, Pavel Butsykin wrote:<br class="">
<blockquote type="cite" class="">Hmm, __kfuse_trace() duplicates message to debugfs trace, without '\n'<br class="">
</blockquote>
<br class="">
Yes, and AFAIS most of the existing messages already come w/o it.<br class="">
</blockquote>
<br class="">
More likely logs without '\n' are present mainly for error cases,<br class="">
perhaps this is why it wasn't noticed before. But yes, we have a mess<br class="">
with logs.<br class="">
<br class="">
I propose to fix all FUSE_K* traces with '\n' and use<br class="">
trace_printk("%s\n") for duplicating messages to debugsfs. But<br class="">
duplicating messages to debugfs should be turned off by default (with<br class="">
the ability to enable via sysfs), because write messages to debugfs<br class="">
without user's permission.. it's looks a little impolite :)<br class="">
</blockquote>
<br class="">
The issue is not in duplicating messages, but in \n creeping into<br class="">
user-space logs. But anyway, OK, equipping them all with \n-s sounds<br class="">
OK to me.<br class="">
</blockquote>
<br class="">
Not any more. Please, look at this PR: <a href="https://git.acronis.com/projects/STRG/repos/pstorage-core/pull-requests/765" class="">
https://git.acronis.com/projects/STRG/repos/pstorage-core/pull-requests/765</a><br class="">
The proposal is to drop the LOG_NONL thing from textual logs. If done, then<br class="">
messages coming with \n at the end will have double \n-s in text logs.<br class="">
</blockquote>
<br class="">
Actually, we don't need to worry about merged messages in debugs,<br class="">
because __trace_puts() adds \n if it necessary:<br class="">
int __trace_puts(unsigned long ip, const char *str, int size)<br class="">
...<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>/* Add a newline if necessary */<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>if (entry->buf[size - 1] != '\n') {<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>entry->buf[size] = '\n';<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>entry->buf[size + 1] = '\0';<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>} else<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>entry->buf[size] = '\0';<br class="">
<br class="">
I missed it in the beginning, sorry for that.<br class="">
<br class="">
Along with this, we can allow drop LOG_NONL options from usermode and<br class="">
this patch is OK for me, except for a small correction:<br class="">
void __kfuse_trace(struct fuse_conn * fc, unsigned long ip, const char * <br class="">
fmt, ...)<br class="">
...<br class="">
-<span class="Apple-tab-span" style="white-space:pre"> </span>pr_debug("%s", buf);<br class="">
+<span class="Apple-tab-span" style="white-space:pre"> </span>pr_debug("%s\n", buf);<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">this messages will look weird. We need to fix __kfuse_trace() by adding<br class="">
concatenation '\n' (or even drop duplication messages to debugsfs/dmesg,<br class="">
as not a very useful thing).<br class="">
<br class="">
On 30.11.2018 17:35, Pavel Butsykin wrote:<br class="">
<blockquote type="cite" class="">Would you like to fix all FUSE_KTRACE's in the kernel? I see a few more<br class="">
FUSE_KTRACE with '\n'.<br class="">
<br class="">
On 30.11.2018 17:23, Pavel Emelianov wrote:<br class="">
<blockquote type="cite" class="">After a recent (b)log (re)work it was noticed that some extra \n-s crept<br class="">
into the classical log files. Indeed, the pstorage TRACE() call appends a<br class="">
\n at the end of each message and so does the kernel code.<br class="">
<br class="">
Sorry for inconvenience.<br class="">
<br class="">
<a href="https://pmc.acronis.com/browse/VSTOR-18383" class="">https://pmc.acronis.com/browse/VSTOR-18383</a><br class="">
<br class="">
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com><br class="">
<br class="">
---<br class="">
<br class="">
diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c<br class="">
index 4596454..34fa88c 100644<br class="">
--- a/fs/fuse/kio/pcs/pcs_map.c<br class="">
+++ b/fs/fuse/kio/pcs/pcs_map.c<br class="">
@@ -1946,7 +1946,7 @@ static int pcs_cslist_submit_read(struct pcs_int_request *ireq, struct pcs_cs_li<br class="">
<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>WRITE_ONCE(csl->read_index, i);<br class="">
<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>WRITE_ONCE(csl->select_stamp, jiffies);<br class="">
<br class="">
-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>FUSE_KTRACE(ireq->cc->fc, "Selected read map " MAP_FMT " to CS" NODE_FMT "; is_seq=%d\n", MAP_ARGS(ireq->iochunk.map),<br class="">
+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>FUSE_KTRACE(ireq->cc->fc, "Selected read map " MAP_FMT " to CS" NODE_FMT "; is_seq=%d", MAP_ARGS(ireq->iochunk.map),<br class="">
<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span> NODE_ARGS(csl->cs[i].cslink.cs->id), is_seq);<br class="">
<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span>pcs_flow_bind_cs(ireq->iochunk.flow, csl->cs[i].cslink.cs);<br class="">
<span class="Apple-tab-span" style="white-space:pre"> </span>}<br class="">
<br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
Devel mailing list<br class="">
<a href="mailto:Devel@openvz.org" class="">Devel@openvz.org</a><br class="">
https://lists.openvz.org/mailman/listinfo/devel<br class="">
<br class="">
</blockquote>
</blockquote>
<br class="">
</blockquote>
</blockquote>
<br class="">
</blockquote>
<br class="">
</blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>