[PATCH]tracepoint.c: Add conditionals num to find_matching_tracepoint

Hui Zhu
2011-08-07T16:30:15Z

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Hi,

I found that when I set some tracepoint to a same address, and use
tsave. And use "target tfile " to open it. It will only one
tracepoint available.
And output some words like:
Created tracepoint 1 for target's tracepoint 1 at 0x40050a.
Assuming tracepoint 1 is same as target's tracepoint 2 at 0x40050a.
Assuming tracepoint 1 is same as target's tracepoint 3 at 0x40050a.

This is because find_matching_tracepoint didn't check the num.

And I think the tracepoint have the same address is really helpful for
user. Because we can set different condition to make tracepoint more
powerful.
So I make following patch.

Please help me review it.

Thanks,
Hui

2011-08-08 Hui Zhu <teawater@gmail.com>

* tracepoint.c (find_matching_tracepoint): Add number check.

[-- Attachment #2: tfile-same-address.txt --]
[-- Type: text/plain, Size: 361 bytes --]

---
tracepoint.c | 1 +
1 file changed, 1 insertion(+)

--- a/tracepoint.c
+++ b/tracepoint.c
@@ -3111,6 +3111,7 @@ find_matching_tracepoint (struct uploade
if (b->type == utp->type
&& t->step_count == utp->step
&& t->pass_count == utp->pass
+ && t->base.number == utp->number
/* FIXME also test conditionals and actions. */
)
{