maxhbr / make_build_analysis

This repo tries to find a way to understand the build graph of a make build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Analysis of Make builds

this repo tries to find a way to statically or dynamically analyze builds done with make.

Analysis via strace

  • tracecode parse: Parses strace output and generates pickle files.
  • tracecdoe list: Collect the inventory of files processed during the tracing
  • tracecode graphic: generate a dot graph out of the build

TODO:

Containes a utility called strace2csv which takes an strace log and generates a csv with the header:

  • timestamp
  • pid
  • executable
  • syscall
  • filepath
  • all_filepaths
  • ret_int
  • ret_str
  • syscall_time

TODO:

TODO:

highjacking comand calls

This generates a JSON file like:

  {
    "arguments": [
      "/usr/bin/gcc",
      "-DLOCALEDIR=\"/usr/local/share/locale\"",
      "-DHAVE_CONFIG_H",
      "-I.",
      "-Ilib",
      "-I./lib",
      "-Isrc",
      "-I./src",
      "-g",
      "-O2",
      "-c",
      "-o",
      "lib/getprogname.o",
      "lib/getprogname.c"
    ],
    "directory": "/src",
    "file": "/src/lib/getprogname.c",
    "output": "/src/lib/getprogname.o"
  },
  {
    "arguments": [ ... ],
    "directory": "/src",
    "file": "/src/lib/c-ctype.c",
    "output": "/src/lib/c-ctype.o"
  },
  {
    "arguments": [ ... ],
    "directory": "/src",
    "file": "/src/lib/c-strncasecmp.c",
    "output": "/src/lib/c-strncasecmp.o"
  },
  {
    "arguments": [ ... ],
    "directory": "/src",
    "file": "/src/lib/closeout.c",
    "output": "/src/lib/closeout.o"
  },
  ...
]

TODO:

TODO:

Log output analysis

Verbose log

Running make V=1

TODO:

Debug log

Runnign make -d.

TODO:

relies on output of make -Bnd. Has no support for sub-Makefiles.

TODO:

Make alternatives

TODO:

About

This repo tries to find a way to understand the build graph of a make build


Languages

Language:Shell 76.8%Language:Dockerfile 23.2%