Git Product home page Git Product logo

Comments (17)

dgryski avatar dgryski commented on May 2, 2024 4

There are a number of pure-Go readline implementations that could be integrated to allow this.

from pprof.

rauls5382 avatar rauls5382 commented on May 2, 2024 1

I have an initial prototype for this using github.com/chzyer/readline at
https://github.com/rauls5382/pprof/tree/readline

Would you like to try it out and see if it is useful? It lets you recall and edit commands from the current session, but it doesn't provide a persistent history across sessions. Would you find this useful, or is cross-session history the most useful part?

from pprof.

rauls5382 avatar rauls5382 commented on May 2, 2024 1

I'm sorry for the long silence on this. I think we can merge in my previous prototype while maintaining the existing version by default. I'll find some time to work on this.

from pprof.

rauls5382 avatar rauls5382 commented on May 2, 2024

This is the upstream repo for the pprof tool. The one in the Go distribution is an old snapshot of this codebase. We plan to eventually refresh it to a more recent version, I believe in Go 1.9

@dgryski : Any pointers to specific readline implementations? Are there any in use in the Go distribution?

from pprof.

whereswaldon avatar whereswaldon commented on May 2, 2024

@rauls5382 Thanks for trying to build it! The workflow that I usually want this feature for is calling back the last command to add some filters. While cross-session history might be useful, it wasn't my goal.

Sadly, I'm having some trouble running it. It compiles fine, but I can't open a profile with it. That said, I also can't open a profile with master. Has the profile format changed since the one shipping as go tool pprof with go 1.6.2? What do I need to do to record a memory profile in the format that this tool expects?

from pprof.

rauls5382 avatar rauls5382 commented on May 2, 2024

No, pprof should still be able to read profiles from older versions. On Go 1.8 now the handlers generate a native profile, but pprof will continue to read profiles from older versions.

If you can, attach a profile here and I can take a look. Did you collect it directly from the URL, or did you use pprof to fetch/save it?

from pprof.

whereswaldon avatar whereswaldon commented on May 2, 2024

@rauls5382 I'm sorry, I did something stupid, and the profile file was empty. Anyway, it works ☁️ wonderfully ☁️. This is exactly what I wanted. Thank you so much! Is there any obstacle to adding this to master?

from pprof.

rauls5382 avatar rauls5382 commented on May 2, 2024

There are some concerns with adding the new dependence to master. I'll work on it but it may take some time. Feel free to continue using my branch until then.

from pprof.

whereswaldon avatar whereswaldon commented on May 2, 2024

Okay, thank you!

from pprof.

levex avatar levex commented on May 2, 2024

Any news on this @rauls5382 ? I'd be happy to take on if you can't continue.

As a workaround, rlwrap seems to be okay for now.

from pprof.

ALTree avatar ALTree commented on May 2, 2024

@aalexand @nolanmar511 thoughts on this? Adding readline support should be relatively easy if some pure-go readline implementation is vendored; I guess the question here is whether it's fine to vendor a readline implementation or not.

from pprof.

aalexand avatar aalexand commented on May 2, 2024

@ALTree pprof is vendored into Golang source tree so I am not enthusiastic about adding a new dependency for this feature request. I wonder if it should be relatively easy to implement some limited readline-like-support without adding a new dependency.

from pprof.

aalexand avatar aalexand commented on May 2, 2024

Could we use https://github.com/golang/crypto/blob/master/ssh/terminal/terminal.go? That seems to have limited history support. Is that less problematic to depend on in golang land?

from pprof.

pedrosland avatar pedrosland commented on May 2, 2024

I don't know if there is a desire to implement more readline features in the future but I would be very happy with only history support and just for the current session.

If @rauls5382 or @levex are busy, I would be willing to pick this up and integrate crypto's terminal.go or just history.

from pprof.

aalexand avatar aalexand commented on May 2, 2024

@rsc @hyangah @mvdan Do you see any issues (in terms of vendoring pprof into Go source tree) with pprof depending on https://github.com/golang/crypto/blob/master/ssh/terminal/terminal.go to implement limited history and editing support in the interactive mode?

from pprof.

mvdan avatar mvdan commented on May 2, 2024

I don't know what the policy is around how much code can be vendored into the Go repository, sorry. I imagine Russ or other members of the Go team will have an opinion on it.

from pprof.

andybons avatar andybons commented on May 2, 2024

Regarding vendoring in the terminal stuff, go for it.

from pprof.

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.