mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
perf trace beauty fcntl: Fix build with older kernel headers
Toolchains with older kernel headers that do not include upstream commitc75b1d9421("fs: add fcntl() interface for setting/getting write life time hints") will now fail to build perf due to missing definitions for F_GET_RW_HINT/F_SET_RW_HINT/F_GET_FILE_RW_HINT/F_SET_FILE_RW_HINT. Provide a fallback definition for these when they are not already defined. Fixes:9c47f66748("perf trace beauty fcntl: Basic 'arg' beautifier") Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Markus Mayer <mmayer@broadcom.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
834c557167
commit
7ee7f48413
|
|
@ -9,6 +9,22 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/fcntl.h>
|
||||
|
||||
#ifndef F_GET_RW_HINT
|
||||
#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
|
||||
#endif
|
||||
|
||||
#ifndef F_SET_RW_HINT
|
||||
#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
|
||||
#endif
|
||||
|
||||
#ifndef F_GET_FILE_RW_HINT
|
||||
#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
|
||||
#endif
|
||||
|
||||
#ifndef F_SET_FILE_RW_HINT
|
||||
#define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14)
|
||||
#endif
|
||||
|
||||
static size_t fcntl__scnprintf_getfd(unsigned long val, char *bf, size_t size, bool show_prefix)
|
||||
{
|
||||
return val ? scnprintf(bf, size, "%s", "0") :
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user