From: George Dunlap <George.Dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] xentrace: Clear lost records when disabling tracing
Date: Mon, 1 Feb 2010 11:00:04 -0800 [thread overview]
Message-ID: <de76405a1002011100x7842e9efl24e71666005f2453@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 316 bytes --]
This patch clears the "lost records" flag on each cpu when tracing is disabled.
Without this patch, the next time tracing starts, cpus with lost
records will generate lost record traces, even though buffers are
empty and no tracing has recently happened.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
[-- Attachment #2: 20100107-unstable-trace-clear-lost-records-on-disable.diff --]
[-- Type: text/x-patch, Size: 1043 bytes --]
diff -r 2c5b7da4b914 xen/common/trace.c
--- a/xen/common/trace.c Wed Jan 06 16:22:18 2010 +0000
+++ b/xen/common/trace.c Thu Jan 07 15:24:15 2010 +0000
@@ -230,11 +230,26 @@
tb_init_done = 1;
break;
case XEN_SYSCTL_TBUFOP_disable:
+ {
/*
* Disable trace buffers. Just stops new records from being written,
* does not deallocate any memory.
*/
+ int i;
+
tb_init_done = 0;
+ wmb();
+ /* Clear any lost-record info so we don't get phantom lost records next time we
+ * start tracing. Grab the lock to make sure we're not racing anyone. After this
+ * hypercall returns, no more records should be placed into the buffers. */
+ for_each_online_cpu(i)
+ {
+ int flags;
+ spin_lock_irqsave(&per_cpu(t_lock, i), flags);
+ per_cpu(lost_records, i)=0;
+ spin_unlock_irqrestore(&per_cpu(t_lock, i), flags);
+ }
+ }
break;
default:
rc = -EINVAL;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2010-02-01 19:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=de76405a1002011100x7842e9efl24e71666005f2453@mail.gmail.com \
--to=george.dunlap@eu.citrix.com \
--cc=xen-devel@lists.xensource.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).