Giter Site home page Giter Site logo

finleymcilwaine / ghc-eventlog-socket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from well-typed/ghc-eventlog-socket

0.0 1.0 0.0 20 KB

Pipe the GHC eventlog stream to a UNIX domain socket

License: BSD 3-Clause "New" or "Revised" License

C 92.85% Haskell 7.15%

ghc-eventlog-socket's Introduction

eventlog-socket

A library to send GHC's eventlog stream over a Unix domain socket.

In your application

executable MyProgram
   ...
   build-depends: eventlog-socket
   ghc-options: -eventlog
import qualified GHC.Eventlog.Socket

main :: IO ()
main = do
    ...
    GHC.Eventlog.Socket.start "/tmp/my-program.eventlog.sock"
    ...
$ ./MyProgram +RTS -l &
$ nc -U /tmp/my-program.eventlog.sock > my-program.eventlog

This is a prototype to play around with the possibility of using the eventlog for realtime profiling and performance analysis. There are still numerous open questions:

  • access control?
  • support only Unix domain sockets or also tcp/ip?
  • do we want to support multiple consumers?
  • what should happen when a consumer disconnects? we could either
    • currently we just pause the eventlog until a new consumer shows up
    • close the socket and stop streaming
    • pause the program until a new consumer shows up
    • kill the program

Development

As the most code is C using following line will speedup development considerably (change your GHC installation path accordingly):

gcc -c -Iinclude -I/opt/ghc/9.0.1/lib/ghc-9.0.1/include -o eventlog_socket.o cbits/eventlog_socket.c
gcc -c -Iinclude -I/opt/ghc/9.2.0.20210821/lib/ghc-9.2.0.20210821/include -o eventlog_socket.o cbits/eventlog_socket.c

ghc-eventlog-socket's People

Contributors

bgamari avatar davideichmann avatar mpickering avatar phadej avatar

Watchers

 avatar

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.