lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Oct 2014 17:07:08 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Jean Pihet <jean.pihet@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Fu Wei <fu.wei@...aro.org>, Robert Richter <rric@...nel.org>,
	Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 1/1] rasd: Use perf_evlist__open() instead of open coded

Em Tue, Oct 07, 2014 at 04:04:33PM +0200, Borislav Petkov escreveu:
> On Tue, Oct 07, 2014 at 10:32:36AM -0300, Arnaldo Carvalho de Melo wrote:
> > Hopefully we will completely remove the need to set up any thread or cpu
> > map, as what you want is syswide tracing, right?
> 
> Yeah, I was questioning the need to open at least one thread even for
> system-wide tracing.

Ok, so what is now at my perf/hists branch at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git

should do the trick, the patch below makes rasd.c use it. I'll try
building rasd.c with it and checking if it works.

Never having tried this, what are the requisites to test it? Some
specific hardware and a kernel with the right tracepoint? I guess some
recent 3.17-rc kernel is all that I need?

- Arnaldo

---

[PATCH] rasd: Use perf_evlist__open() instead of open coded equivalent

Cc: Borislav Petkov <bp@...e.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 src/rasd.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/rasd.c b/src/rasd.c
index 06ccdcdd9d56..d3df9868388c 100644
--- a/src/rasd.c
+++ b/src/rasd.c
@@ -241,9 +241,6 @@ static void daemonize(void)
 
 int main()
 {
-	struct perf_evsel *c;
-	struct thread_map *threads;
-	struct cpu_map *cpus;
 	int i;
 
 	/* Run the process as a daemon */
@@ -266,24 +263,10 @@ int main()
 	if (read_config_file())
 		err("error reading config file");
 
-	/* Set cpu and threads maps */
-	threads = thread_map__new(-1, getpid(), UINT_MAX);
-	if (threads == NULL)
-		err("allocating threads_map\n");
-
-	cpus = cpu_map__new(NULL);
-	if (cpus == NULL)
-		err("allocating cpu_map\n");
-
-	perf_evlist__set_maps(evlist, cpus, threads);
-
 	/* Open events */
-	evlist__for_each(evlist, c) {
-		/* On all online cpus by default, system wide tracing */
-		if (perf_evsel__open(c, evlist->cpus, NULL) < 0)
-			err("opening tracepoint, are you root?");
-	}
-	perf_evlist__set_id_pos(evlist);
+	/* On all online cpus by default, system wide tracing */
+	if (perf_evlist__open(evlist) < 0)
+		err("opening tracepoint, are you root?");
 
 	/* mmap buffers */
 	if (perf_evlist__mmap(evlist, 4 /* opts->mmap_pages */, false) < 0)
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ