All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: "adrian.hunter@intel.com" <adrian.hunter@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"jolsa@redhat.com" <jolsa@redhat.com>,
	"eranian@google.com" <eranian@google.com>,
	"namhyung@gmail.com" <namhyung@gmail.com>,
	"dsahern@gmail.com" <dsahern@gmail.com>,
	"fweisbec@gmail.com" <fweisbec@gmail.com>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: "perf record" if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
Date: Tue, 14 Jul 2015 12:12:26 +0000	[thread overview]
Message-ID: <1436875946.2839.22.camel@synopsys.com> (raw)

Hi Adrian,

Just noticed that starting from Linux v4.2-rc1 "perf record"
doesn't work on ARC. That's what I see:
 ------------>8------------
 # perf record ls -la
 Cannot use AUX area tracing mmaps
 failed to mmap with 38 (Function not implemented)
 ------------>8------------

I believe that happens because by default auxtrace is enabled
(NO_AUXTRACE=0) and so auxtrace_mmap__mmap() from
"tools/perf/util/auxtrace.c" gets compiled in and following
check fails:
 ------------>8------------
 #if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
 	pr_err("Cannot use AUX area tracing mmaps\n");
 	return -1;
 #endif
 ------------>8------------

Unfortunately we don't have __sync_val_compare_and_swap()
in our current toolchain. And ARC as of today is 32-bit architecture.

Now if I pass NO_AUXTRACE=1 in perf building command then everything
works as expected.

So I'm wondering what would be the best way to get perf properly
working for ARC (at least) and probably other architecture/toolchain
combos?

I see at least 2 options:

 [1] Add feature check for BITS_PER_LONG. And then if
     "BITS_PER_LONG != 32 & HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT"
     automatically set "NO_AUXTRACE=1" on building perf.

 [2] By default enable auxtrace only on selected architectures.
     For example Intel 64-bit and maybe others who really capable of
     running auxtrace (and may make use of it).

Any suggestions are much appreciated.

Just in case that's my back-trace to auxtrace_mmap__mmap():
 ------------>8------------
#0  auxtrace_mmap__mmap (mm=0x11a1a44, mp=0x5fa468c0, userpg=0x2021e000, fd=4)
    at util/auxtrace.c:57
#1  0x0005d3b0 in __perf_evlist__mmap (evlist=0x11a0f30, evlist=0x11a0f30, 
    fd=4, mp=0x5fa468b8, idx=0) at util/evlist.c:838
#2  perf_evlist__mmap_per_evsel (evlist=evlist@entry=0x11a0f30, 
    idx=idx@entry=0, mp=mp@entry=0x5fa468b8, cpu=cpu@entry=0, 
    thread=thread@entry=0, output=output@entry=0x5fa468b4) at util/evlist.c:861
#3  0x0005de1e in perf_evlist__mmap_per_cpu (mp=0x5fa468b8, evlist=0x11a0f30)
    at util/evlist.c:910
#4  perf_evlist__mmap_ex (evlist=0x11a0f30, evlist@entry=0x0, 
    pages=<optimized out>, overwrite=overwrite@entry=false, auxtrace_pages=0, 
    auxtrace_overwrite=<optimized out>) at util/evlist.c:1095
#5  0x0001e906 in record__open (rec=0xf11a0 <record>) at builtin-record.c:305
#6  __cmd_record (rec=0xf11a0 <record>, argv=<optimized out>, 
    argc=<optimized out>) at builtin-record.c:519
#7  cmd_record (argc=<optimized out>, argv=<optimized out>, 
    prefix=<optimized out>) at builtin-record.c:1168
#8  0x00053758 in run_builtin (p=p@entry=0xf2938 <commands+72>, 
    argc=argc@entry=2, argv=argv@entry=0x11a1730) at perf.c:370
#9  0x00053f10 in handle_internal_command (argv=0x11a1730, argc=2)
    at perf.c:429
#10 run_argv (argv=0x5fa47c70, argcp=0x5fa47c74) at perf.c:473
#11 main (argc=2, argv=0x5fa47d98) at perf.c:588
 ------------>8------------

-Alexey

             reply	other threads:[~2015-07-14 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 12:12 Alexey Brodkin [this message]
2015-07-14 12:36 ` "perf record" if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) Adrian Hunter
2015-07-14 12:52   ` Alexey Brodkin
2015-07-14 13:02     ` Adrian Hunter
2015-07-14 14:12       ` Arnaldo Carvalho de Melo
2015-07-18  3:21   ` [tip:perf/urgent] perf auxtrace: Fix misplaced check for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT tip-bot for Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436875946.2839.22.camel@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.