Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 16 Feb 2004 17:06:35 -0500 (EST)
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: Thomas L Roche <tlroche@us.ibm.com>
cc: cygwin@cygwin.com
Subject: Re: limiting strace?
In-Reply-To: <OFE69182E5.7B22BC15-ON85256E3C.00741973-85256E3C.00764ABA@us.ibm.com>
Message-ID: <Pine.GSO.4.56.0402161659050.26191@slinky.cs.nyu.edu>
References: <OFE69182E5.7B22BC15-ON85256E3C.00741973-85256E3C.00764ABA@us.ibm.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Scanned-By: MIMEDefang 2.39

On Mon, 16 Feb 2004, Thomas L Roche wrote:

> On Mon, 16 Feb 2004, Thomas L Roche wrote:
> >> Is there a way to limit the [strace] file size directly, or to
> >> script its rotation?
>
> Igor Pechtchanski 02/16/2004 03:56:10 PM:
> > You're on Cygwin, man!  Use the scripting tools! :-)
>
> The will is there! It's the howto I need :-(
>
> > Don't forget that strace by default sends the trace to stdout. You
> > can then pipe it to any program you wish (e.g., "tail -100", or
>
> That part I understand, and I know how to use those tools to *report
> from* strace.out ... but that's not what I'm trying to do. I don't
> want to say, "give me the last million lines from strace.out"--windows
> being what it is, if the file's big enough I may not get a chance to
> ask!

Simple: don't output the trace to a file.  The "by default" up there means
that if you don't supply the "-o" option, strace will send the trace to
stdout.

> I want instead to say something like, "don't let strace.out get bigger
> than a million lines," or 1GB, or something like that. How to do
> _that_, script wizards?

Umm, how about something like the line below?

strace unzip whatever | tail -1000000 > strace.out 2>&1 &

No wizardry involved here.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

