On Thu 04-10-18 00:25:38, Amir Goldstein wrote: > In order to identify which thread triggered the event in a > multi-threaded program, add the FAN_EVENT_INFO_TID flag in fanotify_init > to opt-in for reporting the event creator's thread id information. > > Signed-off-by: nixiaoming <nixiaoming@xxxxxxxxxx> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> ... > diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h > index afddd7e0d5a1..05b696b4856b 100644 > --- a/include/linux/fanotify.h > +++ b/include/linux/fanotify.h > @@ -18,7 +18,10 @@ > #define FANOTIFY_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ > FAN_CLASS_PRE_CONTENT) > > +#define FANOTIFY_EVENT_INFO_FLAGS (FAN_EVENT_INFO_TID) > + > #define FANOTIFY_INIT_FLAGS (FANOTIFY_CLASS_BITS | \ > + FANOTIFY_EVENT_INFO_FLAGS | \ > FAN_CLOEXEC | FAN_NONBLOCK | \ > FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS) Is there reason to define FANOTIFY_EVENT_INFO_FLAGS? But I guess you prepare with this for further changes you want to do? Just that at this point it looks a bit silly and I cannot really think of a reason why we'd like to distinguish flags in FANOTIFY_EVENT_INFO_FLAGS from other flags in FANOTIFY_INIT_FLAGS... Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR