On 12/17/19 1:47 AM, Wenbo Zhang wrote: > trace fstat events by tracepoint syscalls/sys_enter_newfstat, and handle > events only produced by test_file_fd_path, which call fstat on several > different types of files to test bpf_fd_file_path's feature. > > v5->v6: addressed Gregg and Yonghong's feedback > - rename to get_fd_path > - change sys_enter_newfstat_args's fd type to long to fix issue on > big-endian machines > > v4->v5: addressed Andrii's feedback > - pass NULL for opts as bpf_object__open_file's PARAM2, as not really > using any > - modify patch subject to keep up with test code > - as this test is single-threaded, so use getpid instead of SYS_gettid > - remove unnecessary parens around check which after if (i < 3) > - in kern use bpf_get_current_pid_tgid() >> 32 to fit getpid() in > userspace part > - with the patch adding helper as one patch series > > v3->v4: addressed Andrii's feedback > - use a set of fd instead of fds array > - use global variables instead of maps (in v3, I mistakenly thought that > the bpf maps are global variables.) > - remove uncessary global variable path_info_index > - remove fd compare as the fstat's order is fixed > > v2->v3: addressed Andrii's feedback > - use global data instead of perf_buffer to simplified code > > v1->v2: addressed Daniel's feedback > - rename bpf_fd2path to bpf_get_file_path to be consistent with other > helper's names > > Signed-off-by: Wenbo Zhang <ethercflow@xxxxxxxxx> Acked-by: Yonghong Song <yhs@xxxxxx>