GithubHelp home page GithubHelp logo

Option for a time limit about flamegraph HOT 3 OPEN

theimpostor avatar theimpostor commented on June 14, 2024 1
Option for a time limit

from flamegraph.

Comments (3)

djc avatar djc commented on June 14, 2024

The -c option will let you write a custom perf command. Does that help? I'd also be open to reviewing a PR to add this. (In the end, flamegraph is a pretty thin wrapper over running perf -- at least on Linux.)

from flamegraph.

theimpostor avatar theimpostor commented on June 14, 2024

Hmm, it doesn't seem to like the way I'm supplying a command to perf. Here I'm trying to grab a trace from pid 11736 for 60 seconds:

❯ flamegraph -c 'sudo perf record -p 11736 -g -F 999 -- sleep 60'
Error: no workload given to generate a flamegraph for

✖1 ❯ flamegraph -p 11736 -c 'sudo perf record -p 11736 -g -F 999 -- sleep 60'
perf: 'sudo' is not a perf-command. See 'perf --help'.
failed to sample program

✖1 ❯ flamegraph -p 11736 -c 'perf record -p 11736 -g -F 999 -- sleep 60' --root
perf: 'perf' is not a perf-command. See 'perf --help'.
failed to sample program

✖1 ❯ flamegraph -p 11736 -c 'record -p 11736 -g -F 999 -- sleep 60' --root
Couldn't synthesize bpf events.
sleep: invalid option -- 'p'
Try 'sleep --help' for more information.
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.133 MB perf.data (366 samples) ]
failed to sample program

✖1 ❯ flamegraph -p 11736 -c 'record -g -F 999 -- sleep 60' --root
Couldn't synthesize bpf events.
sleep: invalid option -- 'p'
Try 'sleep --help' for more information.
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.011 MB perf.data (8 samples) ]
failed to sample program

from flamegraph.

djc avatar djc commented on June 14, 2024

When you invoke flamegraph with -v it should print the full perf command, maybe that helps debug this?

from flamegraph.

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.