public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Tracepoints (and python)
@ 2012-12-20  2:36 Marc Brünink
  2012-12-20 14:33 ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Marc Brünink @ 2012-12-20  2:36 UTC (permalink / raw)
  To: gdb

I have no idea about gdb internals. I m trying to learn, though. Questions:

1. Is there any technical reason why tracing is only possible on remote targets? Or is is "just" not implemented for anything else.
2. Anyone working on making tracepoints available to the python interface? Any pitfalls to expect?

Marc

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2012-12-20  2:36 Tracepoints (and python) Marc Brünink
@ 2012-12-20 14:33 ` Tom Tromey
  2012-12-21  8:55   ` Hui Zhu
  2012-12-28  0:43   ` Doug Evans
  0 siblings, 2 replies; 9+ messages in thread
From: Tom Tromey @ 2012-12-20 14:33 UTC (permalink / raw)
  To: Marc Brünink; +Cc: gdb

>>>>> "Marc" == Marc Brünink <marc@nus.edu.sg> writes:

Marc> 1. Is there any technical reason why tracing is only possible on
Marc> remote targets? Or is is "just" not implemented for anything else.

I think the only reason is that nobody has done it.

Marc> 2. Anyone working on making tracepoints available to the python
Marc> interface? Any pitfalls to expect?

Nobody has worked on this.
I wouldn't predict any particularly tricky problems, at least not for
representing the tracepoints themselves.  I'm less sure about
representing the trace state.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2012-12-20 14:33 ` Tom Tromey
@ 2012-12-21  8:55   ` Hui Zhu
  2013-01-02 17:27     ` Tom Tromey
  2012-12-28  0:43   ` Doug Evans
  1 sibling, 1 reply; 9+ messages in thread
From: Hui Zhu @ 2012-12-21  8:55 UTC (permalink / raw)
  To: Marc Brünink; +Cc: Tom Tromey, gdb

On Thu, Dec 20, 2012 at 10:32 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Marc" == Marc Brünink <marc@nus.edu.sg> writes:
>
> Marc> 1. Is there any technical reason why tracing is only possible on
> Marc> remote targets? Or is is "just" not implemented for anything else.
>
> I think the only reason is that nobody has done it.
>
> Marc> 2. Anyone working on making tracepoints available to the python
> Marc> interface? Any pitfalls to expect?
>
> Nobody has worked on this.
> I wouldn't predict any particularly tricky problems, at least not for
> representing the tracepoints themselves.  I'm less sure about
> representing the trace state.
>

I wrote some python code with tracepoint to parse the traceframe from
target (my target is KGTP).  You can get a example in
http://code.google.com/p/kgtp/wiki/hotcode

I have 3 issues with it:
1. Not sure about upstream, but when I use it, it is hard to setup
tracepoint action with python.  How I handle it is write tracepoint
and action to a GDB source file and call soure command in python
script.

2. Another is the performance issue.  If you have a lot of traceframe
need to be analysed by python,  you will get it.  And actually, the
url that I posted is about a python+gdb performance issue and a
solution of it.

3. The last one is if you can handle traceframe with python, maybe you
think you can keep analyse the traceframe from target.  But current
tracepoint doesn't it.  You must "tstart", "tstop", parse.
What I handle it is let KGTP supply a special interface in tfile
format.  Then GDB can keep get traceframe from it without stop
tracepoint.

> Tom

Thanks,
Hui

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2012-12-20 14:33 ` Tom Tromey
  2012-12-21  8:55   ` Hui Zhu
@ 2012-12-28  0:43   ` Doug Evans
  2013-01-02 17:28     ` Tom Tromey
  1 sibling, 1 reply; 9+ messages in thread
From: Doug Evans @ 2012-12-28  0:43 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Marc Brünink, gdb

On Thu, Dec 20, 2012 at 6:32 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Marc" == Marc Brünink <marc@nus.edu.sg> writes:
>
> Marc> 1. Is there any technical reason why tracing is only possible on
> Marc> remote targets? Or is is "just" not implemented for anything else.
>
> I think the only reason is that nobody has done it.

This is part of gdb/gdbserver feature parity desires right?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2012-12-21  8:55   ` Hui Zhu
@ 2013-01-02 17:27     ` Tom Tromey
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2013-01-02 17:27 UTC (permalink / raw)
  To: Hui Zhu; +Cc: Marc Brünink, gdb

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> I have 3 issues with it:
Hui> 1. Not sure about upstream, but when I use it, it is hard to setup
Hui> tracepoint action with python.  How I handle it is write tracepoint
Hui> and action to a GDB source file and call soure command in python
Hui> script.

Yeah, I think you would be better off writing a new Python API to make
tracepoints directly.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2012-12-28  0:43   ` Doug Evans
@ 2013-01-02 17:28     ` Tom Tromey
  2013-01-02 17:44       ` Doug Evans
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2013-01-02 17:28 UTC (permalink / raw)
  To: Doug Evans; +Cc: Marc Brünink, gdb

Marc> 1. Is there any technical reason why tracing is only possible on
Marc> remote targets? Or is is "just" not implemented for anything else.

Tom> I think the only reason is that nobody has done it.

Doug> This is part of gdb/gdbserver feature parity desires right?

It is on the list on the wiki, but I think just to mention it as a
difference.  We (meaning Red Hat) plan to tackle most of the items on
that list, but I don't think this is one we are going to do.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2013-01-02 17:28     ` Tom Tromey
@ 2013-01-02 17:44       ` Doug Evans
  2013-01-11  7:29         ` Marc Brünink
  0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2013-01-02 17:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Marc Brünink, gdb

On Wed, Jan 2, 2013 at 10:28 AM, Tom Tromey <tromey@redhat.com> wrote:
> Marc> 1. Is there any technical reason why tracing is only possible on
> Marc> remote targets? Or is is "just" not implemented for anything else.
>
> Tom> I think the only reason is that nobody has done it.
>
> Doug> This is part of gdb/gdbserver feature parity desires right?
>
> It is on the list on the wiki, but I think just to mention it as a
> difference.  We (meaning Red Hat) plan to tackle most of the items on
> that list, but I don't think this is one we are going to do.

[Sorry for the resend, previous one got sent as text/html.]

Thanks.

For clarity's sake for  Marc,
what's needed isn't so much an implementation as a (pretty
significant) refactor.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2013-01-02 17:44       ` Doug Evans
@ 2013-01-11  7:29         ` Marc Brünink
  2013-01-11  8:12           ` Yao Qi
  0 siblings, 1 reply; 9+ messages in thread
From: Marc Brünink @ 2013-01-11  7:29 UTC (permalink / raw)
  To: Doug Evans; +Cc: Tom Tromey, gdb


On Jan 3, 2013, at 1:44 AM, Doug Evans wrote:

> On Wed, Jan 2, 2013 at 10:28 AM, Tom Tromey <tromey@redhat.com> wrote:
>> Marc> 1. Is there any technical reason why tracing is only possible on
>> Marc> remote targets? Or is is "just" not implemented for anything else.
>> 
>> Tom> I think the only reason is that nobody has done it.
>> 
>> Doug> This is part of gdb/gdbserver feature parity desires right?
>> 
>> It is on the list on the wiki, but I think just to mention it as a
>> difference.  We (meaning Red Hat) plan to tackle most of the items on
>> that list, but I don't think this is one we are going to do.
> 
> [Sorry for the resend, previous one got sent as text/html.]
> 
> Thanks.
> 
> For clarity's sake for  Marc,
> what's needed isn't so much an implementation as a (pretty
> significant) refactor.

Interesting. Actually I am trying to implement a rudimentary application tracer using the python interface. So far I have simply used breakpoints. It works like a charm but is obviously very slow. Thus, I want to switch to tracepoints. Having access to tracepoints during native debugging would be nice but is not necessary. This is a point for my personal wish list.
Another issue is the trace buffer. It would be nice to get a notification as soon as the trace buffer is full. Currently gdbserver does not sent one (assuming gdb is connected), does it?

Marc

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Tracepoints (and python)
  2013-01-11  7:29         ` Marc Brünink
@ 2013-01-11  8:12           ` Yao Qi
  0 siblings, 0 replies; 9+ messages in thread
From: Yao Qi @ 2013-01-11  8:12 UTC (permalink / raw)
  To: Marc Brünink; +Cc: Doug Evans, Tom Tromey, gdb

On 01/11/2013 03:29 PM, Marc Brünink wrote:
> Another issue is the trace buffer. It would be nice to get a notification as soon as the trace buffer is full. Currently gdbserver does not sent one (assuming gdb is connected), does it?

We have patches being reviewed/discussed about "the remote async 
notification on trace stopped due to trace buffer is full". 
http://sourceware.org/ml/gdb-patches/2012-12/msg00687.html

Once it goes in, users attach function to 'trace_stop' observer, and get 
notified when the trace is stopped.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-11  8:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20  2:36 Tracepoints (and python) Marc Brünink
2012-12-20 14:33 ` Tom Tromey
2012-12-21  8:55   ` Hui Zhu
2013-01-02 17:27     ` Tom Tromey
2012-12-28  0:43   ` Doug Evans
2013-01-02 17:28     ` Tom Tromey
2013-01-02 17:44       ` Doug Evans
2013-01-11  7:29         ` Marc Brünink
2013-01-11  8:12           ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).