Displaying 10 results from an estimated 10 matches for "siguser1".
2007 Jan 31
1
SIGUSER1 and rsync
Hi,
What is the behaviour of rsync on receiving SIGUSER1 signal? Can I block it
in someway so that my application that repeatedly calls rsync and rsync
itself will run smoothly.
Regards,
Preeti
-------------- next part --------------
HTML attachment scrubbed and removed
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
....
+raw_ostream &llvm::dbgs() {
+ // Do one-time initialization in a thread-safe way.
+ static struct dbgstream {
+ circular_raw_ostream strm;
+
+ dbgstream() : strm(errs(), DebugBufferSize) {
+ sys::AddSignalHandler(&debug_user_sig_handler, 0);
+ // TODO: Add a handler for SIGUSER1-type signals so the user can
+ // force a debug dump.
+ }
+ } thestrm;
+
+ return thestrm.strm;
+}
+
#else
// Avoid "has no symbols" warning.
namespace llvm {
-int Debug_dummy = 0;
+ /// dbgs - Return dbgs().
+ raw_ostream &dbgs() {
+ return dbgs();
+ }
}
+
#endif
2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
On Dec 18, 2009, at 6:36 PM, David Greene wrote:
>>> +// Signal handlers - dump debug output on termination.
>>> +static void debug_user_sig_handler(void *Cookie)
>>> +{
>>> + llvm::circular_raw_ostream *logout =
>>> + dynamic_cast<llvm::circular_raw_ostream *>(&llvm::dbgs());
>>
>> Please do not use dynamic_cast, we're
2009 Dec 21
0
[LLVMdev] [PATCH] Implement dbgs()
On 2009-12-21 18:06, David Greene wrote:
> On Saturday 19 December 2009 00:16, Chris Lattner wrote:
>
>
>>> Or I think I can just assume (Yikes!) that if the signal handler is
>>> invoked it will really be a circular_raw_ostream since the handler
>>> should (!) only be set up in debug mode.
>>>
>>> That scares me a bit, though.
>>>
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...atic struct dbgstream {
+ circular_raw_ostream strm;
+
+ dbgstream() :
+ strm(errs(),
+ (DisableDebugBuffering || !DebugFlag) ? 0 : DebugBufferSize) {
+ if (!DisableDebugBuffering && DebugFlag && DebugBufferSize != 0)
+ // TODO: Add a handler for SIGUSER1-type signals so the user can
+ // force a debug dump.
+ sys::AddSignalHandler(&debug_user_sig_handler, 0);
+ // Otherwise we've already set the debug stream buffer size to
+ // zero, disabling buffering.
+ }
+ } thestrm;
+
+ return thestrm.strm;
+}
+
#else
//...
2009 Dec 19
3
[LLVMdev] [PATCH] Implement dbgs()
On Friday 18 December 2009 19:56, Chris Lattner wrote:
> > +// -debug-buffer-size - This is a command line op0tion to set the
> > size
> > +// of the debug stream circular buffer. The value is the number of
> > +// characters to save.
> > +static cl::opt<unsigned>
> > +DebugBufferSize("debug-buffer-size",
> > +
2009 Dec 18
2
[LLVMdev] [PATCH] Implement dbgs()
...r-buffered debug stream.
+raw_ostream &llvm::dbgs() {
+ static circular_raw_ostream strm(errs(), DebugBufferSize);
+
+ static bool initialized = false;
+ if (!initialized) {
+ initialized = true;
+
+ sys::AddSignalHandler(&debug_user_sig_handler, 0);
+ // TODO: Add a handler for SIGUSER1-type signals so the user can
+ // force a debug dump.
+ }
+
+ return strm;
+}
+
#else
// Avoid "has no symbols" warning.
namespace llvm {
-int Debug_dummy = 0;
+ /// dbgs - Return errs().
+ raw_ostream &dbgs() {
+ return errs();
+ }
}
+
#endif
2009 Dec 19
0
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Dec 18, 2009, at 3:46 PM, David Greene wrote:
>
> + /// circular_raw_ostream - A raw_ostream that saves its output in a
> + /// circular buffer.
A better description would be "which *can* save its data to a circular
buffer, or can pass it through directly to an underlying stream if
specified with a buffer of zero."
When it is buffering, what causes it to flush? Your
2009 Dec 19
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
...like
> flush_to_underlying_stream() or something like that?
Currently, it uses a signal handler. It's important that one gets output
on a SIGTERM, SIGSGEV and other such things and I don't know that object
desctruction is guaranteed in those cases.
Eventually we'll want to dump on SIGUSER1 as well but there's no generic
libSystem hook for that yet.
> > + /// DELETE_STREAM - Tell the destructor to delete the held
> > stream.
> > + ///
> > + static const bool DELETE_STREAM = true;
> > +
> > + /// PRESERVE_STREAM - Tell the destructo...
2009 Dec 18
2
[LLVMdev] [PATCH] Circular Buffered Debug Stream
On Friday 18 December 2009 17:27, David Greene wrote:
> > Here's the updated patch.
>
> Well, that didn't go through right. Here it is again.
Argh! Stupid bug fixed. :)
Index: include/llvm/Support/circular_raw_ostream.h
===================================================================
--- include/llvm/Support/circular_raw_ostream.h (revision 0)
+++