Re: [PATCH v2] perf lock: add "info" subcommand for dumping misc information

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Frederic Weisbecker
Date: Friday, April 30, 2010 - 11:49 am

On Sat, Apr 24, 2010 at 07:46:41PM +0900, Hitoshi Mitake wrote:


I've eventually not queued it because of some various
problems, see below:





That only walks the left nodes of the rbtree, imagine the following
rbtree, W are visited nodes, U are the unvisited:

                   Root
                 /      \
                W        U
              /  \      / \
             W    U    U   U


Better iterate using rb_first() then rb_next() until it is NULL.





You won't ever have !st because container_of computes an address
based on a struct type and a contained address inside this struct.

struct thread_stat {
	struct list_head	hash_entry;
	struct rb_node		rb;
	[...]
} ts;

If ts->rb == 1000, ts == 1000 - 16 or something like this.

What matters is the "if (!node)" check you did before.






Please don't use printf anymore (I did the same mistakes lately),
now that are using a TUI and we might use a GUI one day, we
can't assume anymore we are dealing with a normal stdout.

So better use pr_debug, pr_err, pr_warning, etc...






Same here and below.





No it's not ugly, it's ok, we do this everywhere in perf tools :)

Thanks.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL] perf tools updates, Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 1/9] perf lock: Fix state machine to recognize lock ..., Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 2/9] perf: Fix initialization bug in parse_single_t ..., Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 3/9] perf: Generalize perf lock's sample event reor ..., Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 4/9] perf: Use generic sample reordering in perf sched, Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 5/9] perf: Use generic sample reordering in perf kmem, Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 6/9] perf: Use generic sample reordering in perf trace, Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 7/9] perf: Use generic sample reordering in perf ti ..., Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 8/9] perf: Add a perf trace option to check samples ..., Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
[PATCH 9/9] perf: Some perf-kvm documentation edits, Frederic Weisbecker, (Fri Apr 23, 7:05 pm)
Re: [GIT PULL] perf tools updates, Frederic Weisbecker, (Fri Apr 23, 7:27 pm)
Re: [PATCH 8/9] perf: Add a perf trace option to check sam ..., Frederic Weisbecker, (Sun Apr 25, 11:08 am)
Re: [GIT PULL] perf tools updates, Ingo Molnar, (Tue Apr 27, 2:15 am)
Re: [PATCH v2] perf lock: add "info" subcommand for dumpin ..., Frederic Weisbecker, (Fri Apr 30, 11:49 am)
[PATCH] perf lock: track only specified threads, Hitoshi Mitake, (Thu May 6, 2:32 am)
Re: [PATCH] perf lock: track only specified threads, Frederic Weisbecker, (Thu May 6, 5:49 pm)
Re: [PATCH] perf lock: track only specified threads, Hitoshi Mitake, (Sat May 8, 1:02 am)
[tip:perf/core] perf lock: Add "info" subcommand for dumpi ..., tip-bot for Hitoshi ..., (Mon May 10, 12:19 am)