Giter Site home page Giter Site logo

Comments (7)

namhyung avatar namhyung commented on August 29, 2024
  1. Yep, it should be supported by kernel. In fact kernel has an option for this but it only shows "exit" records so I decided not use it for now.
  2. it needs to be implemented in kernel. Did you mean at replay?
  3. it looks like a bug. I'll take a look it.

from uftrace.

honggyukim avatar honggyukim commented on August 29, 2024

2 . Yes, I mean 'trace' trigger support for replay command.

from uftrace.

namhyung avatar namhyung commented on August 29, 2024

For item 2, it was because filter address requires full 64 bit address but file format only saves 48 bit to reduce space. We need to sign-extend the address before giving it to filters. Does below patch fixes the issue?

diff --git a/utils/kernel.c b/utils/kernel.c
index d886cc0..4c8052c 100644
--- a/utils/kernel.c
+++ b/utils/kernel.c
@@ -872,13 +872,16 @@ static int read_kernel_cpu(struct ftrace_file_handle *handle, int cpu)
                        if (delta < handle->time_filter) {
                                struct ftrace_session *sess = first_session;
                                struct ftrace_trigger tr = {};
+                               unsigned long real_addr;

+                               /* filter match needs full (64-bit) address */
+                               real_addr = get_real_address(curr->addr);
                                /*
                                 * it might set TRACE trigger, which shows
                                 * function even if it's less than the time filter.
                                 */
                                ftrace_match_filter(&sess->filters,
-                                                   curr->addr, &tr);
+                                                   real_addr, &tr);
                                if (tr.flags & TRIGGER_FL_TRACE) {
                                        add_to_rstack_list(rstack_list, curr, NULL);
                                        break;

from uftrace.

honggyukim avatar honggyukim commented on August 29, 2024

It works fine with above patch. Thanks!

from uftrace.

namhyung avatar namhyung commented on August 29, 2024

For item 3, I think below patch should fix it.

diff --git a/cmd-graph.c b/cmd-graph.c
index 49460a5..fc207fd 100644
--- a/cmd-graph.c
+++ b/cmd-graph.c
@@ -394,6 +394,12 @@ static int build_graph(struct opts *opts, struct ftrace_file_handle *handle, cha
                struct sym *sym = NULL;
                char *name;

+               if (opts->kernel_skip_out) {
+                       /* skip kernel functions outside user functions */
+                       if (!task->user_stack_count && is_kernel_address(frs->addr))
+                               continue;
+               }
+
                if (!fstack_check_filter(task))
                        continue;

from uftrace.

namhyung avatar namhyung commented on August 29, 2024

@honggyukim can you please check the current code and close this issue if it's done?

from uftrace.

honggyukim avatar honggyukim commented on August 29, 2024

@namhyung Yeap, I tested it and found that all the issues are resolved now. Sorry for the late answer.

from uftrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.