linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Li, Ming Chun" <macli@brc.ubc.ca>
To: Mel Gorman <mel@csn.ul.ie>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-mm@kvack.org
Subject: Re: [PATCH 4/6] tracing, page-allocator: Add a postprocessing script for page-allocator-related ftrace events
Date: Fri, 7 Aug 2009 12:10:05 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.1.00.0908071154120.14649@mail.selltech.ca> (raw)
In-Reply-To: <1249666815-28784-5-git-send-email-mel@csn.ul.ie>

On Fri, 7 Aug 2009, Mel Gorman wrote:

> +sub generate_traceevent_regex {
> +	my $event = shift;
> +	my $default = shift;
> +	my @fields = @_;
> +	my $regex;

You are using shift to retrieve parameters below, @fields is not used 
anywhere.

> +
> +	# Read the event format or use the default
> +	if (!open (FORMAT, "/sys/kernel/debug/tracing/events/$event/format")) {
> +		$regex = $default;
> +	} else {
> +		my $line;
> +		while (!eof(FORMAT)) {
> +			$line = <FORMAT>;
> +			if ($line =~ /^print fmt:\s"(.*)",.*/) {
> +				$regex = $1;
> +				$regex =~ s/%p/\([0-9a-f]*\)/g;
> +				$regex =~ s/%d/\([-0-9]*\)/g;
> +				$regex =~ s/%lu/\([0-9]*\)/g;
> +			}
> +		}
> +	}
> +
> +	# Verify fields are in the right order
> +	my $tuple;
> +	foreach $tuple (split /\s/, $regex) {
> +		my ($key, $value) = split(/=/, $tuple);
> +		my $expected = shift;
> +		if ($key ne $expected) {
> +			print("WARNING: Format not as expected '$key' != '$expected'");
> +			$regex =~ s/$key=\((.*)\)/$key=$1/;
> +		}
> +	}
> +	if (defined $_) {
> +		die("Fewer fields than expected in format");
> +	}
> +

How about:
	if (defined shift) {
		die("Fewer fields than expected in format");
	}
? 

I don't know, just ask if it is clear.

> +	return $regex;
> +}


Vincent Li
Biomedical Research Center
University of British Columbia

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-08-07 18:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 17:40 [PATCH 0/6] Add some trace events for the page allocator v5 Mel Gorman
2009-08-07 17:40 ` [PATCH 1/6] tracing, page-allocator: Add trace events for page allocation and page freeing Mel Gorman
2009-08-08  5:47   ` KOSAKI Motohiro
2009-08-07 17:40 ` [PATCH 2/6] tracing, page-allocator: Add trace events for anti-fragmentation falling back to other migratetypes Mel Gorman
2009-08-07 17:40 ` [PATCH 3/6] tracing, page-allocator: Add trace event for page traffic related to the buddy lists Mel Gorman
2009-08-07 17:40 ` [PATCH 4/6] tracing, page-allocator: Add a postprocessing script for page-allocator-related ftrace events Mel Gorman
2009-08-07 19:10   ` Li, Ming Chun [this message]
2009-08-07 19:32     ` Li, Ming Chun
2009-08-10  7:41       ` Mel Gorman
2009-08-07 17:40 ` [PATCH 5/6] tracing, documentation: Add a document describing how to do some performance analysis with tracepoints Mel Gorman
2009-08-07 17:40 ` [PATCH 6/6] tracing, documentation: Add a document on the kmem tracepoints Mel Gorman
  -- strict thread matches above, loose matches on Subject: below --
2009-08-10 15:41 [PATCH 0/6] Add some trace events for the page allocator v6 Mel Gorman
2009-08-10 15:41 ` [PATCH 4/6] tracing, page-allocator: Add a postprocessing script for page-allocator-related ftrace events Mel Gorman
2009-08-06 16:07 [PATCH 0/4] Add some trace events for the page allocator v4 Mel Gorman
2009-08-06 16:07 ` [PATCH 4/6] tracing, page-allocator: Add a postprocessing script for page-allocator-related ftrace events Mel Gorman
2009-08-06 21:07   ` Li, Ming Chun
2009-08-07 11:13     ` Mel Gorman
2009-08-07  8:00   ` Ingo Molnar
2009-08-07 14:16     ` Mel Gorman

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=alpine.DEB.1.00.0908071154120.14649@mail.selltech.ca \
    --to=macli@brc.ubc.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /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