Commit Graph

73 Commits

Author SHA1 Message Date
Omar Sandoval
87dd27ee12 setup.py: build in parallel by default
This is especially helpful for pip which doesn't have an easy way to
pass build parameters (and most people wouldn't bother, anyways).
2020-01-24 16:47:56 -08:00
Omar Sandoval
ce06683861 vmtest/run: always get list of source files from SOURCES.txt
The next change will make non-git builds depend on a fully-formed source
distribution. So, let's copy in everything from SOURCES.txt, which
should include the egg metadata and anything else setuptools decides is
important.
2020-01-23 10:02:29 -08:00
Omar Sandoval
660276a0b8 Format Python code with Black
I'm not a fan of 100% of the Black coding style, but I've spent too much
time manually formatting Python code, so let's just pull the trigger.
2020-01-14 11:51:58 -08:00
Omar Sandoval
d71b57e3e8 vmtest/manage: scrub compilation directory in debug info
In order to make builds slightly more reproducible (and avoid leaking
details about the build machine's directory layout), let's remap the
compilation directory in DW_AT_comp_dir to be empty.
2020-01-13 11:15:26 -08:00
Omar Sandoval
e0c6a2281d travis.yml: add 5.5 to vmtest kernels
v5.5-rc1 was released this week. Run vmtest with it.
2019-12-11 22:34:20 -08:00
Omar Sandoval
00f5d5b034 vmtest: fix README link 2019-12-04 09:57:43 -08:00
Omar Sandoval
b727e39aa2 vmtest: split files up by architecture
For now, x86_64 is the only architecture, but in the future we will want
to test on others. Let's rearrange things now while it's not too
disruptive.
2019-12-04 03:32:46 -08:00
Omar Sandoval
1721a42dcd vmtest: rename bzImage uploads to vmlinuz
Not all architectures name the bootable image bzImage, so to make
supporting other architectures easier in the future, let's use the more
generic name, vmlinuz.
2019-12-03 22:59:57 -08:00
Omar Sandoval
a3acea9027 vmtest/manage: check that commit exists before trying to build
If I forget to git fetch, manage.py tries to build releases that don't
exist, which litters the repository with incomplete build-$release
directories. Verify that the commit exists before we do anything.
2019-12-03 15:29:15 -08:00
Omar Sandoval
cbe0900ba9 vmtest/manage: handle paginated shared folder webpage
The vmtest shared folder just got large enough to be paginated, which
manage.py doesn't handle. Handle it by making the same XHR requests that
the webpage makes in a browser.
2019-12-03 15:14:14 -08:00
Omar Sandoval
5b1cdded3c vmtest: support running with local kernel build
This is useful for experimenting.
2019-11-29 13:02:22 -08:00
Omar Sandoval
e00373de3c vmtest: use rsync -c to copy vmlinux and source files
This is safer than relying on the existence/time stamps of the files in
the disk image.
2019-11-29 13:02:22 -08:00
Omar Sandoval
26b2708f5e vmtest: add long options to run.sh
Use getopt instead of getopts and add long options.
2019-11-29 13:02:22 -08:00
Omar Sandoval
1c9acb8eed Add virtual machine testing setup
Now that we have tests for kernel-specific functionality, we should run
them on various kernel versions. This adds a script for doing so using
QEMU with a pre-built root filesystem image and kernels that I'm hosting
on my Dropbox. The script can be run locally, but this also sets it up
to be run on Travis. For now, we're testing the mainline, stable, and
longterm releases from kernel.org (not including v3.16, which doesn't
even boot for me).
2019-11-22 16:54:00 -08:00
Omar Sandoval
1cedca8ff4 Import elfutils
Based on:

c950e8a9 config: Fix spec file, add manpages and new GFDL license.

With the following patches:

configure: Add --disable-programs
configure: Add --disable-shared
configure: Fix -D_FORTIFY_SOURCE=2 check when CFLAGS contains -Wno-error
libcpu: compile i386_lex.c with -Wno-implicit-fallthrough

The plan is to stop relying on the distribution's version of elfutils
and instead ship our own. This gives us freedom to assume that we're
using the latest version and even ship our own patches (starting with a
few build system improvements). More details are in
scripts/update-elfutils.sh, which was used to generate this commit.
2019-09-05 01:04:33 -07:00
Omar Sandoval
932b7857b5 libdrgn: expose primitive type concept to public interface
Previously known as c_type.
2019-05-06 14:55:34 -07:00
Omar Sandoval
75c3679147 Rewrite drgn core in C
The current mixed Python/C implementation works well, but it has a
couple of important limitations:

- It's too slow for some common use cases, like iterating over large
  data structures.
- It can't be reused in utilities written in other languages.

This replaces the internals with a new library written in C, libdrgn. It
includes Python bindings with mostly the same public interface as
before, with some important improvements:

- Types are now represented by a single Type class rather than the messy
  polymorphism in the Python implementation.
- Qualifiers are a bitmask instead of a set of strings.
- Bit fields are not considered a separate type.
- The lvalue/rvalue terminology is replaced with reference/value.
- Structure, union, and array values are better supported.
- Function objects are supported.
- Program distinguishes between lookups of variables, constants, and
  functions.

The C rewrite is about 6x as fast as the original Python when using the
Python bindings, and about 8x when using the C API directly.

Currently, the exposed API in C is fairly conservative. In the future,
the memory reader, type index, and object index APIs will probably be
exposed for more flexibility.
2019-04-02 14:12:07 -07:00
Omar Sandoval
c2d51fe295 Support userspace program core dumps
We only need to add a little bit of infrastructure to map variable
addresses for ASLR/shared libraries, which we find using the NT_FILE
note.
2018-07-09 22:34:03 -07:00
Omar Sandoval
800ee3ec36 corereader: take fd and list of segments instead of path
Now, we can get rid of the ELF parsing implementation in CoreReader.
Instead, we parse in ElfFile and pass the parsed information to
CoreReader.
2018-07-09 19:12:33 -07:00
Omar Sandoval
3ff1cc185a variableindex: distinguish vmlinux vs modules with ELF e_type
For /boot/vmlinux-$(uname -r) or if passed a vmlinux image with -e, the
basename of vmlinux is not always exactly "vmlinux". Don't rely on the
filename.
2018-07-03 00:27:56 -07:00
Omar Sandoval
263f8c2c4d dwarf: update DWARF constants
Update generate_dwarf_constants.py to parse dwarf.h, and update it with
the dwarf.h on my system.
2018-06-27 22:31:01 -07:00
Omar Sandoval
0adac0747c Bring back ElfFile
Instead of constructing DwarfFile with a dict of sections, pass in an
ElfFile.
2018-06-25 23:43:14 -07:00
Omar Sandoval
76cba644a8 Reorganize packaging 2018-04-07 10:42:48 -07:00