aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 3fdfbaebd95e..6c3719ac901d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1656,6 +1656,21 @@ static int parse_clockid(const struct option *opt, const char *str, int unset)
1656 return -1; 1656 return -1;
1657} 1657}
1658 1658
1659static int record__parse_affinity(const struct option *opt, const char *str, int unset)
1660{
1661 struct record_opts *opts = (struct record_opts *)opt->value;
1662
1663 if (unset || !str)
1664 return 0;
1665
1666 if (!strcasecmp(str, "node"))
1667 opts->affinity = PERF_AFFINITY_NODE;
1668 else if (!strcasecmp(str, "cpu"))
1669 opts->affinity = PERF_AFFINITY_CPU;
1670
1671 return 0;
1672}
1673
1659static int record__parse_mmap_pages(const struct option *opt, 1674static int record__parse_mmap_pages(const struct option *opt,
1660 const char *str, 1675 const char *str,
1661 int unset __maybe_unused) 1676 int unset __maybe_unused)
@@ -1964,6 +1979,9 @@ static struct option __record_options[] = {
1964 &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)", 1979 &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
1965 record__aio_parse), 1980 record__aio_parse),
1966#endif 1981#endif
1982 OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
1983 "Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer",
1984 record__parse_affinity),
1967 OPT_END() 1985 OPT_END()
1968}; 1986};
1969 1987