unsigned int            min_stack;
        int                     raw_augmented_syscalls_args_size;
        bool                    raw_augmented_syscalls;
+       bool                    fd_path_disabled;
        bool                    sort_events;
        bool                    not_ev_qualifier;
        bool                    live;
 {
        struct thread_trace *ttrace = thread__priv(thread);
 
-       if (ttrace == NULL)
+       if (ttrace == NULL || trace->fd_path_disabled)
                return NULL;
 
        if (fd < 0)
 
        ret = perf_evsel__sc_tp_uint(evsel, ret, sample);
 
-       if (sc->is_open && ret >= 0 && ttrace->filename.pending_open) {
+       if (!trace->fd_path_disabled && sc->is_open && ret >= 0 && ttrace->filename.pending_open) {
                trace__set_fd_pathname(thread, ret, ttrace->filename.name);
                ttrace->filename.pending_open = false;
                ++trace->stats.vfs_getname;
        if (trace->syscalls.prog_array.sys_enter)
                trace__init_syscalls_bpf_prog_array_maps(trace);
 
-
        if (trace->ev_qualifier_ids.nr > 0) {
                err = trace__set_ev_qualifier_filter(trace);
                if (err < 0)
                }
        }
 
+       /*
+        * If the "close" syscall is not traced, then we will not have the
+        * opportunity to, in syscall_arg__scnprintf_close_fd() invalidate the
+        * fd->pathname table and were ending up showing the last value set by
+        * syscalls opening a pathname and associating it with a descriptor or
+        * reading it from /proc/pid/fd/ in cases where that doesn't make
+        * sense.
+        *
+        *  So just disable this beautifier (SCA_FD, SCA_FDAT) when 'close' is
+        *  not in use.
+        */
+       trace->fd_path_disabled = !trace__syscall_enabled(trace, syscalltbl__id(trace->sctbl, "close"));
+
        err = perf_evlist__apply_filters(evlist, &evsel);
        if (err < 0)
                goto out_error_apply_filters;