Re: [PATCH v2] trace-cmd: Move trace_msg cache file to memfd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun,  3 Apr 2022 23:18:25 +0000
Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:

> +++ b/lib/trace-cmd/trace-msg.c
> @@ -593,11 +593,9 @@ tracecmd_msg_handle_alloc(int fd, unsigned long flags)
>  int tracecmd_msg_handle_cache(struct tracecmd_msg_handle *msg_handle)
>  {
>  	if (msg_handle->cfd < 0) {
> -		strcpy(msg_handle->cfile, MSG_CACHE_FILE);
> -		msg_handle->cfd = mkstemp(msg_handle->cfile);
> +		msg_handle->cfd = memfd_create("trace_msg_cache", 0);
>  		if (msg_handle->cfd < 0)
>  			return -1;
> -		unlink(msg_handle->cfile);
>  	}

This causes:

trace-profile.c:23:3: warning: #warning "lib audit not found, using raw syscalls " "(install audit-libs-devel(for fedora) or libaudit-dev(for debian/ubuntu) and try again)" [-Wcpp]
   23 | # warning "lib audit not found, using raw syscalls "    \
      |   ^~~~~~~


Care to send a v3 update?

Man page shows:

SYNOPSIS
       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include <sys/mman.h>

       int memfd_create(const char *name, unsigned int flags);

Note, all of trace-cmd is compiled with _GNU_SOURCE set.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux