[CRIU] [PATCH 0/1] Preliminary patch to allow dumping BPF map files

Abhishek Vijeev abhishek.vijeev at gmail.com
Mon Apr 20 21:52:29 MSK 2020


Hi,

I'd like to resolve this issue: https://github.com/checkpoint-restore/criu/issues/777.
I've started work, and would like feedback on code and the general direction in which I am 
proceeding. Kindly let me know whether you would prefer multiple smaller patches.

Also, kindly let me know if you would prefer a Pull Request submission. The reason I have not 
done this is because in my opinion, it would make more sense to submit a Pull Request
after both dumping and restoration of BPF map files works successfully.
 
A few comments I'd like to make:

a) As a first goal, I'm trying to dump information about BPF map files. I will move to the
restore phase once dump works successfully, and I get a green signal from the CRIU community.

b) bpfmap-file.proto => I've only added fields that the proc filesystem shows me (for the
BPF map file), based on my best judgement. I will improve this as soon as I better understand 
which fields are optional and required for BPF maps.

c) As far as I understand, to dump BPF files, the only thing left to do is parse the BPF map
information from the proc filesystem by modifying parse_fdinfo_pid_s() function in criu/proc_parse.c
(https://github.com/checkpoint-restore/criu/blob/criu-dev/criu/proc_parse.c#L1690). Is there
something else that I'm missing?

I await your kind feedback.

Thank you,
Abhishek Vijeev.

Abhishek Vijeev (1):
  Preliminary set of changes to support dumping BPF map files. A major
    task is yet to be completed: parsing BPF file info from the proc
    filesystem in the function parse_fdinfo_pid_s()

 criu/Makefile.crtools    |  1 +
 criu/bpfmap.c            | 49 ++++++++++++++++++++++++++++++++++++++++
 criu/files.c             |  5 ++++
 criu/include/bpfmap.h    |  9 ++++++++
 images/Makefile          |  1 +
 images/bpfmap-file.proto | 23 +++++++++++++++++++
 images/fdinfo.proto      |  4 ++++
 7 files changed, 92 insertions(+)
 create mode 100644 criu/bpfmap.c
 create mode 100644 criu/include/bpfmap.h
 create mode 100644 images/bpfmap-file.proto

-- 
2.17.1



More information about the CRIU mailing list