Giter VIP home page Giter VIP logo

Comments (5)

LalitMaganti avatar LalitMaganti commented on May 30, 2024

The code to do the conversion can be found at https://cs.android.com/android/platform/superproject/main/+/main:external/perfetto/src/perfetto_cmd/config.cc but TLDR:

  • -t maps to duration_ms in the config
  • all of the atrace categories map to the atrace_categories section of the linux.ftrace datasource

see the "full trace config" section of https://perfetto.dev/docs/quickstart/android-tracing#recording-a-trace-through-the-cmdline for information on this.

from perfetto.

primiano avatar primiano commented on May 30, 2024

In general the best way to solve this problem is:

  1. Capture a trace via the cmdline (`-t 20s yada yada')
  2. Open the trace with the UI and look at the 'Info and stats page'
  3. Copy the full text config that is reported there. That is the translation that the code lalit linked does.
  4. profit

from perfetto.

wjj1928 avatar wjj1928 commented on May 30, 2024

Wow, that smart way! one question I have Trace.beginSection("MySection") in java code, but with that config, I still not see "MySection" keyword in trace, any other config should I add for this?

from perfetto.

LalitMaganti avatar LalitMaganti commented on May 30, 2024

I still not see "MySection" keyword in trace, any other config should I add for this?

You are likely not including your app's package in atrace_apps section of the config.

from perfetto.

primiano avatar primiano commented on May 30, 2024

-a 'app name', which translates into atrace_apps: "app name" in the ftrace section of the config.
Example:

data_sources {
  config {
    name: "linux.ftrace"
    target_buffer: 0
    trace_duration_ms: 0
    tracing_session_id: 0
    enable_extra_guardrails: false
    ftrace_config {
      ftrace_events: "sched/sched_switch"
      ftrace_events: "power/suspend_resume"
      ...
      atrace_apps: "lmkd"   # !!!!!!!!!!!!!!!!! THIS
    }

from perfetto.

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.