public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: pmachata@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix chained tracing Date: Fri, 20 Jun 2008 13:55:00 -0000 [thread overview] Message-ID: <20080620135506.11372.qmail@sourceware.org> (raw) The branch, master has been updated via c69c6ceede39e0ffa06f94321447a25e0d0e2b4d (commit) from 0f35edb5f6c7423f39c875d47182ff3708419e7d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit c69c6ceede39e0ffa06f94321447a25e0d0e2b4d Author: Petr Machata <pmachata@redhat.com> Date: Fri Jun 20 15:54:16 2008 +0200 Fix chained tracing * i.e. the case when regular entry is hit right after PLT entry for the same symbol is hit. In such a case these two entry points share the same return breakpoint, and the situation has to be handled specially. This used to be implemented, but got lost during the migration to Frysk breakpoint structures. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/ftrace/ChangeLog | 10 +++++++++- frysk-core/frysk/ftrace/Ftrace.java | 22 +++++++--------------- frysk-core/frysk/ftrace/TaskTracer.java | 18 +++++++++++++++++- 3 files changed, 33 insertions(+), 17 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/ftrace/ChangeLog b/frysk-core/frysk/ftrace/ChangeLog index 3fe6e9b..e2943d3 100644 --- a/frysk-core/frysk/ftrace/ChangeLog +++ b/frysk-core/frysk/ftrace/ChangeLog @@ -1,6 +1,14 @@ 2008-06-20 Petr Machata <pmachata@redhat.com> - * Ftrace.java: Keep a list of event entry tokens, and align + * Ftrace.java (getDriversForTask): Drop. + (driversForTask): Actually use it as a map(task->driver), instead + of map(task->map(mapping_path->driver)). + * TaskTracer.java (FunctionReturnObserver.add): Compare symbol + names via .equals, instead of comparing symbol pointers. + +2008-06-20 Petr Machata <pmachata@redhat.com> + + * Reporter.java: Keep a list of event entry tokens, and align eventLeave with matching eventEntry. 2008-06-10 Andrew Cagney <cagney@redhat.com> diff --git a/frysk-core/frysk/ftrace/Ftrace.java b/frysk-core/frysk/ftrace/Ftrace.java index 17d81ba..b19c39e 100644 --- a/frysk-core/frysk/ftrace/Ftrace.java +++ b/frysk-core/frysk/ftrace/Ftrace.java @@ -654,15 +654,6 @@ public class Ftrace { return ObjectFile.buildFromFile(mapping.path); } - private Map getDriversForTask(Task task) { - Map drivers = (Map)driversForTask.get(task); - if (drivers == null) { - drivers = new HashMap(); - driversForTask.put(task, drivers); - } - return drivers; - } - public Action updateMappedFile(Task task, MemoryMapping mapping) { if (traceMmapUnmap) @@ -677,10 +668,12 @@ public class Ftrace { DwflModule module = getModuleForFile(task, mapping.path); - Map drivers = getDriversForTask(task); - Driver driver = new TaskTracer(Ftrace.this, task); - drivers.put(mapping.path, driver); - this.tracingController.fileMapped(task, objf, module, driver); + Driver driver = (Driver)driversForTask.get(task); + if (driver == null) { + driver = new TaskTracer(Ftrace.this, task); + driversForTask.put(task, driver); + } + tracingController.fileMapped(task, objf, module, driver); task.requestUnblock(this); return Action.BLOCK; @@ -700,8 +693,7 @@ public class Ftrace { DwflModule module = getModuleForFile(task, mapping.path); - Map drivers = getDriversForTask(task); - Driver driver = (Driver)drivers.get(mapping.path); + Driver driver = (Driver)driversForTask.get(task); if (driver == null) throw new AssertionError("There should be a driver for `" + mapping.path + "'."); diff --git a/frysk-core/frysk/ftrace/TaskTracer.java b/frysk-core/frysk/ftrace/TaskTracer.java index 0ae6b0f..1aff7b6 100644 --- a/frysk-core/frysk/ftrace/TaskTracer.java +++ b/frysk-core/frysk/ftrace/TaskTracer.java @@ -81,6 +81,7 @@ class TaskTracer private final Ftrace ftrace; public TaskTracer(Ftrace ftrace, Task task) { + fine.log("New TaskTracer for", task); this.arch = ArchFactory.instance.getArch(task); this.ftrace = ftrace; } @@ -89,7 +90,20 @@ class TaskTracer { private final DwflSymbol symbol; private final boolean isPlt; + + /** + * TracePoint is chained when it shares return breakpoint with + * other breakpoint. When such a breakpoint is hit, it is + * assumed that both tracepoints have "left". This is used + * when both PLT and regular entry point are traced for one + * symbol. If PLT entry point hits, and regular entry point + * for the same symbol hits immediately after that, the two + * are chained. + */ private boolean chained = false; + + // When the TracePoint is frozen, it can't be chained to + // another TracePoint anymore. private boolean frozen = false; public TracePoint(DwflSymbol symbol) { @@ -119,6 +133,7 @@ class TaskTracer } public void setChained() { + fine.log("chained tracePoint", this); this.chained = true; } @@ -169,7 +184,8 @@ class TaskTracer TracePoint previous = (TracePoint)symbolList.getLast(); if (!previous.isFrozen() && previous.isPlt() && !tracePoint.isPlt() - && previous.getSymbol() == tracePoint.getSymbol()) + && previous.getSymbol().getName().equals + (tracePoint.getSymbol().getName())) tracePoint.setChained(); previous.freeze(); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-06-20 13:55 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080620135506.11372.qmail@sourceware.org \ --to=pmachata@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).