Giter Site home page Giter Site logo

gperftools-httpd's Introduction

This code is not from Google.  It is a copy of thttpd 2.25b downloaded
from  http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
but then adapted to be a tiny minimal HTTP server
that can be linked into any program to serve 
profiling information for google-perftools's pprof.

It has been chopped up significantly compared to the original.

After running make (which assumes you have the google-perftools
libraries installed in /usr/local/lib or a standard place like /usr/lib),
you can profile an arbitrary program with:

	LD_PRELOAD=/usr/local/lib/libghttpd-preload.so ./a.out

and then while it is running, execute:

	pprof a.out http://localhost:9999/pprof/heap

The preload library starts the HTTP server at the first call
to malloc.  Alternately, you can link with -lghttpd and call ghttpd()
during program initialization (e.g., in main).

You can change the port number by setting the environment 
variable GHTTPPORT:

	GHTTPPORT=12345 LD_PRELOAD=libghttpd-preload.so ./a.out

Russ Cox
18 October 2006 
[email protected]

gperftools-httpd's People

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.