Re: [PATCH 3/4] gcov: add gcov profiling infrastructure

From: Li Wei
Date: Thu Feb 26 2009 - 05:33:29 EST


On Thu, 2009-02-26 at 11:00 +0100, Peter Oberparleiter wrote:
> Since a few RCs have been released since the last gcov-kernel patch
> post, I'll do a full re-post with a fix similar to the one you suggested
> included.

Thanks! It would be great if ".."s in object pathnames could also be
supported in the forth coming re-post.

I have some external modules which link with object files outside their
directories. For example, a source tree looks like

module0/main.c
lib0/lib.c

and the Kbuild file has to use

main-y += ../lib0/lib.o

to link in lib.c. Current gcov-kernel does not support ".." in
pathnames. Could ".."s be handled in add_node?

---
kernel/gcov/fs.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index aab3be7..2f92955 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -500,6 +500,15 @@ static void add_node(struct gcov_info *info)
if (curr == next)
continue;
*next = 0;
+ if (!strcmp(curr, "."))
+ continue;
+ if (!strcmp(curr, "..")) {
+ if (parent != &root_node) {
+ parent = parent->parent;
+ continue;
+ } else
+ goto out_err;
+ }
node = get_child_by_name(parent, curr);
if (!node) {
node = new_node(parent, NULL, curr);
--
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/