From: Asias He <asias.hejun@gmail.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>, Ingo Molnar <mingo@elte.hu>,
Sasha Levin <levinsasha928@gmail.com>,
Prasad Joshi <prasadjoshi124@gmail.com>,
kvm@vger.kernel.org, Asias He <asias.hejun@gmail.com>
Subject: [PATCH 6/6] kvm tools: Introduce a helper to show the blocked signals
Date: Thu, 16 Jun 2011 00:48:11 +0800 [thread overview]
Message-ID: <1308156491-18488-6-git-send-email-asias.hejun@gmail.com> (raw)
In-Reply-To: <1308156491-18488-1-git-send-email-asias.hejun@gmail.com>
This helper shows the blocked signals of the calling thread.
Signed-off-by: Asias He <asias.hejun@gmail.com>
---
tools/kvm/include/kvm/util.h | 1 +
tools/kvm/util.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/tools/kvm/include/kvm/util.h b/tools/kvm/include/kvm/util.h
index 95d86b9..6fd0f7e 100644
--- a/tools/kvm/include/kvm/util.h
+++ b/tools/kvm/include/kvm/util.h
@@ -68,6 +68,7 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
return strncmp(str, prefix, len) ? NULL : str + len;
}
+void sig_prt_blocked(const char *str);
int sig_block(int n);
#endif /* KVM__UTIL_H */
diff --git a/tools/kvm/util.c b/tools/kvm/util.c
index 204230e..2f2dcf6 100644
--- a/tools/kvm/util.c
+++ b/tools/kvm/util.c
@@ -101,6 +101,23 @@ size_t strlcat(char *dest, const char *src, size_t count)
return res;
}
+void sig_prt_blocked(const char *str)
+{
+ sigset_t sigset;
+ int i;
+
+ printf("-> %s : Blocked sig: ", str);
+
+ if (pthread_sigmask(0, NULL, &sigset) < 0)
+ return;
+ for (i = 1; i < _NSIG; i++) {
+ if (sigismember(&sigset, i))
+ printf("%d ", i);
+ }
+ printf("\n");
+
+}
+
int sig_block(int n)
{
sigset_t sigset;
--
1.7.5.4
prev parent reply other threads:[~2011-06-15 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 16:48 [PATCH 1/6] kvm tools: Introduce a helper to block a singal for a thread Asias He
2011-06-15 16:48 ` [PATCH 2/6] kvm tools: Block SIGALRM for both rx and tx thread for virtio net Asias He
2011-06-15 16:48 ` [PATCH 3/6] kvm tools: Block SIGALRM for theadpool thread Asias He
2011-06-15 16:48 ` [PATCH 4/6] kvm tools: Block SIGALRM for ioeventfd thread Asias He
2011-06-15 16:48 ` [PATCH 5/6] kvm tools: Block SIGALRM for vcpu thread using sig_block() helper Asias He
2011-06-15 20:23 ` Ingo Molnar
2011-06-15 16:48 ` Asias He [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=1308156491-18488-6-git-send-email-asias.hejun@gmail.com \
--to=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=mingo@elte.hu \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@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