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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 3 Nov 2017 07:20:39 -0700
From:   tip-bot for Jiri Olsa <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     hpa@...or.com, changbin.du@...el.com, yao.jin@...ux.intel.com,
        tglx@...utronix.de, acme@...hat.com, linux-kernel@...r.kernel.org,
        jolsa@...nel.org, peterz@...radead.org, dsahern@...il.com,
        wangnan0@...wei.com, andi@...stfloor.org, namhyung@...nel.org,
        mingo@...nel.org
Subject: [tip:perf/core] perf tools: Add perf_data_file__write function

Commit-ID:  e268687bfb73bb7bfe65f23f5cba5c8a0e5bb050
Gitweb:     https://git.kernel.org/tip/e268687bfb73bb7bfe65f23f5cba5c8a0e5bb050
Author:     Jiri Olsa <jolsa@...nel.org>
AuthorDate: Mon, 23 Jan 2017 22:42:56 +0100
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 30 Oct 2017 13:38:50 -0300

perf tools: Add perf_data_file__write function

Adding perf_data_file__write function to provide single file write
operation.

Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: Changbin Du <changbin.du@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-c3f9p4xzykr845ktqcek6p4t@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/data.c | 8 +++++++-
 tools/perf/util/data.h | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index 07ef56a..f80a23d 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -144,10 +144,16 @@ void perf_data__close(struct perf_data *data)
 	close(data->file.fd);
 }
 
+ssize_t perf_data_file__write(struct perf_data_file *file,
+			      void *buf, size_t size)
+{
+	return writen(file->fd, buf, size);
+}
+
 ssize_t perf_data__write(struct perf_data *data,
 			      void *buf, size_t size)
 {
-	return writen(data->file.fd, buf, size);
+	return perf_data_file__write(&data->file, buf, size);
 }
 
 int perf_data__switch(struct perf_data *data,
diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h
index 1797bed..000c43bb 100644
--- a/tools/perf/util/data.h
+++ b/tools/perf/util/data.h
@@ -50,6 +50,8 @@ int perf_data__open(struct perf_data *data);
 void perf_data__close(struct perf_data *data);
 ssize_t perf_data__write(struct perf_data *data,
 			      void *buf, size_t size);
+ssize_t perf_data_file__write(struct perf_data_file *file,
+			      void *buf, size_t size);
 /*
  * If at_exit is set, only rename current perf.data to
  * perf.data.<postfix>, continue write on original data.

Powered by blists - more mailing lists