Giter Club home page Giter Club logo

Comments (8)

tmm1 avatar tmm1 commented on July 23, 2024

Stacktrace?

from stackprof.

juanxo avatar juanxo commented on July 23, 2024

Here you are:

$ stackprof tmp/stackprof-wall-5031-1389574951.dump --limit=6

==================================
  Mode: wall(1000)                                                                                                                                            
  Samples: 23758 (0.94% miss rate)
  GC: 3610 (15.19%)                                                                                                                                           
==================================
(...)

$ stackprof tmp/stackprof-wall-5031-1389574951.dump --limit 6

/home/vagrant/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/stackprof-0.2.2/bin/stackprof:30:in `binread': No such file or directory @ rb_sysopen - 6 (Errno::ENOENT)
        from /home/vagrant/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/stackprof-0.2.2/bin/stackprof:30:in `<top (required)>' 
        from /home/vagrant/.rbenv/versions/2.1.0/bin/stackprof:23:in `load'
        from /home/vagrant/.rbenv/versions/2.1.0/bin/stackprof:23:in `<main>'

from stackprof.

tmm1 avatar tmm1 commented on July 23, 2024

Very strange, I don't see this behavior in my environment.. AFAIK, optparse is supposed to handle both forms.

from stackprof.

pedrogimenez avatar pedrogimenez commented on July 23, 2024

In fact, I think the = sign is required because it's not inside the square brackets:

bin/stackprof#L16

o.on('--limit=[num]', ... )

bin/stackprof#L18

o.on('--method=[grep]', ... )

bin/stackprof#L19

o.on('--file=[grep]', ... )

This version works for me:

  o.on('--text', 'Text summary per method (default)'){ options[:format] = :text }
  o.on('--files', 'List of files'){ |f| options[:format] = :files }
  o.on('--limit [=num]', Integer, 'Limit --text or --files output to N lines'){ |n| options[:limit] = n }
  o.on('--sort-total', "Sort --text or --files output on total samples\n\n"){ options[:sort] = true }
  o.on('--method [=grep]', 'Zoom into specified method'){ |f| options[:format] = :method; options[:filter] = f }
  o.on('--file [=grep]', 'Show annotated code for specified file'){ |f| options[:format] = :file; options[:filter] = f }
  o.on('--callgrind', 'Callgrind output (use with kcachegrind, gprof2dot)'){ options[:format] = :callgrind }
  o.on('--graphviz', "Graphviz output (use with dot)\n\n"){ options[:format] = :graphviz }
  o.on('--debug', 'Pretty print raw profile data'){ options[:format] = :debug }

@juanxo could you test it?

from stackprof.

juanxo avatar juanxo commented on July 23, 2024

yep, I can confirm this too 👍
Note that the blank between the switch name and the [=val] is necessary

from stackprof.

pedrogimenez avatar pedrogimenez commented on July 23, 2024

@tmm1: what are your thoughts?

Should I make a PR?

from stackprof.

tmm1 avatar tmm1 commented on July 23, 2024

Did this break in 26a7259?

Please open a PR, I'll merge.

from stackprof.

pedrogimenez avatar pedrogimenez commented on July 23, 2024

Indeed, You broke it in 26a7259.

It doesn't need the = sign at all.

from stackprof.

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.