<div dir="ltr">Hi,<div><br></div><div>I'd like to follow up on my previous email. I haven't been able to make progress on this</div><div>front, and would appreciate any pointers to help me dump the data of BPF maps.</div><div><br></div><div>Thank you,</div><div>Abhishek Vijeev.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 3, 2020 at 5:56 PM Abhishek Vijeev <<a href="mailto:abhishek.vijeev@gmail.com">abhishek.vijeev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><br>I've been working on enabling CRIU to c/r BPF map files. The following PR reads<div>information about BPF maps from procfs, dumps it and creates new maps with the</div><div>same parameters upon restoration:<br><br><a href="https://github.com/checkpoint-restore/criu/pull/1044" target="_blank">https://github.com/checkpoint-restore/criu/pull/1044</a><br><br>For my next goal, I'd like to c/r the data stored in these maps. However, the BPF<br>system call does not provide an interface to retrieve all data stored in BPF maps<br>without prior information about the data stored.<br><br>I shall now describe the problem I'm faced with. Let's take the example of a BPF</div><div>map that stores key-value pairs in the form of a hash table. Here are its contents: <div><br>Key Value<br> a 1<br> b 2<br> c 3<br><br>To extract all data stored in this map, I must iterate through all key-value pairs using<br>BPF_MAP_GET_NEXT_KEY, starting with a lookup key that doesn't exist in the map.</div><div>(i.e. anything other than 'a', 'b' or 'c'). Given that I don't know the data type of the</div><div>keys or the contents of the map, how must I generate a key that doesn't exist in the</div><div>map? It is important that the lookup key is not present in the map because in that</div><div>case, I will only be able to iterate through keys that occur after this lookup key. For</div><div>example, using 'b' as the lookup key would miss out the first key-value pair ('a'->1).<div><br>I'm looking for guidance to solve this problem, and would appreciate any help.<br><br>Thank you,<br>Abhishek Vijeev.<br><br></div></div></div></div>
</blockquote></div>