From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935193AbdGTIrA (ORCPT ); Thu, 20 Jul 2017 04:47:00 -0400 Received: from terminus.zytor.com ([65.50.211.136]:58677 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934375AbdGTIq6 (ORCPT ); Thu, 20 Jul 2017 04:46:58 -0400 Date: Thu, 20 Jul 2017 01:44:43 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: linux-kernel@vger.kernel.org, dsahern@gmail.com, acme@redhat.com, adrian.hunter@intel.com, hpa@zytor.com, namhyung@kernel.org, wangnan0@huawei.com, mingo@kernel.org, jolsa@kernel.org, tglx@linutronix.de Reply-To: hpa@zytor.com, namhyung@kernel.org, acme@redhat.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, jolsa@kernel.org, tglx@linutronix.de, mingo@kernel.org, wangnan0@huawei.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace beauty: Export the fd beautifier for use in more places Git-Commit-ID: fc65eb8213a437b43e9de7776699aaa25dfa00df X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fc65eb8213a437b43e9de7776699aaa25dfa00df Gitweb: http://git.kernel.org/tip/fc65eb8213a437b43e9de7776699aaa25dfa00df Author: Arnaldo Carvalho de Melo AuthorDate: Fri, 14 Jul 2017 15:21:40 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:02 -0300 perf trace beauty: Export the fd beautifier for use in more places Now that the beautifiers are being split into multiple source and object files, we will need more of them exported, do it for the 'fd' one, will be used to augment the return of some syscalls that may return an 'fd', such as fcntl(fd, F_DUPFD). Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-39sosu12hhywyunqf5s74ewf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 8 +------- tools/perf/trace/beauty/beauty.h | 3 +++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index cfa8bf1..65fa012 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -365,11 +365,6 @@ static size_t syscall_arg__scnprintf_strhexarray(char *bf, size_t size, #define SCA_STRHEXARRAY syscall_arg__scnprintf_strhexarray #endif /* defined(__i386__) || defined(__x86_64__) */ -static size_t syscall_arg__scnprintf_fd(char *bf, size_t size, - struct syscall_arg *arg); - -#define SCA_FD syscall_arg__scnprintf_fd - #ifndef AT_FDCWD #define AT_FDCWD -100 #endif @@ -1057,8 +1052,7 @@ static const char *thread__fd_path(struct thread *thread, int fd, return ttrace->paths.table[fd]; } -static size_t syscall_arg__scnprintf_fd(char *bf, size_t size, - struct syscall_arg *arg) +size_t syscall_arg__scnprintf_fd(char *bf, size_t size, struct syscall_arg *arg) { int fd = arg->val; size_t printed = scnprintf(bf, size, "%d", fd); diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index b64c411..790e830 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -31,6 +31,9 @@ unsigned long syscall_arg__val(struct syscall_arg *arg, u8 idx); size_t syscall_arg__scnprintf_strarrays(char *bf, size_t size, struct syscall_arg *arg); #define SCA_STRARRAYS syscall_arg__scnprintf_strarrays +size_t syscall_arg__scnprintf_fd(char *bf, size_t size, struct syscall_arg *arg); +#define SCA_FD syscall_arg__scnprintf_fd + size_t syscall_arg__scnprintf_hex(char *bf, size_t size, struct syscall_arg *arg); #define SCA_HEX syscall_arg__scnprintf_hex