From fba7a78220fd969beeaa9abbb97c5f7027a7b4fd Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 21 Dec 2012 15:00:58 -0500 Subject: tools lib traceevent: test correct variable after allocation we've tested the wrong variable for allocation failure, fix it to test the right one. Cc: Frederic Weisbecker Cc: Namhyung Kim Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1356120062-2648-1-git-send-email-sasha.levin@oracle.com Signed-off-by: Sasha Levin Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/lib') diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 5a824e355d04..7538a1f9c557 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2481,7 +2481,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char ** free_token(token); arg = alloc_arg(); - if (!field) { + if (!arg) { do_warning("%s: not enough memory!", __func__); *tok = NULL; return EVENT_ERROR; -- cgit v1.2.3-59-g8ed1b From 7b9f6b402c756975ac4e23a5f1bfa261c7c90017 Mon Sep 17 00:00:00 2001 From: Jon Stanley Date: Fri, 7 Sep 2012 16:32:46 -0400 Subject: tools lib traceevent: Update FSF postal address to be URL's. The FSF now prefers to use URL's in copyright headers rather than their postal address. This change updates the address to be per http://www.gnu.org/licenses/gpl-howto.html Signed-off-by: Jon Stanley Acked-by: Steven Rostedt Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1347049967-3143-1-git-send-email-jonstanley@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 3 +-- tools/lib/traceevent/event-parse.h | 3 +-- tools/lib/traceevent/event-utils.h | 3 +-- tools/lib/traceevent/parse-filter.c | 3 +-- tools/lib/traceevent/trace-seq.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) (limited to 'tools/lib') diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 7538a1f9c557..dc42e55469d1 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -13,8 +13,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * License along with this program; if not, see * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 24a4bbabc5d5..7be7e89533e4 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -13,8 +13,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * License along with this program; if not, see * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/tools/lib/traceevent/event-utils.h b/tools/lib/traceevent/event-utils.h index bc075006966e..e76c9acb92cd 100644 --- a/tools/lib/traceevent/event-utils.h +++ b/tools/lib/traceevent/event-utils.h @@ -13,8 +13,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * License along with this program; if not, see * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 5ea4326ad11f..2500e75583fc 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -13,8 +13,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * License along with this program; if not, see * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/tools/lib/traceevent/trace-seq.c b/tools/lib/traceevent/trace-seq.c index b1ccc923e8a5..a57db805136a 100644 --- a/tools/lib/traceevent/trace-seq.c +++ b/tools/lib/traceevent/trace-seq.c @@ -13,8 +13,7 @@ * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * License along with this program; if not, see * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -- cgit v1.2.3-59-g8ed1b From 2d2481ddf634695aa17ad91bd765572329941674 Mon Sep 17 00:00:00 2001 From: Jon Stanley Date: Sat, 8 Sep 2012 14:00:51 -0400 Subject: tools lib traceevent: Add copyright header Adding a missing copyright header to parse-utils.c. Assuminng that the license is LGPL like the rest of the trace-cmd library code. Signed-off-by: Jon Stanley Acked-by: Steven Rostedt Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1347127251-4695-1-git-send-email-jonstanley@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/parse-utils.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools/lib') diff --git a/tools/lib/traceevent/parse-utils.c b/tools/lib/traceevent/parse-utils.c index f023a133abb6..bba701cf10e6 100644 --- a/tools/lib/traceevent/parse-utils.c +++ b/tools/lib/traceevent/parse-utils.c @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2010 Red Hat Inc, Steven Rostedt + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License (not later!) + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ #include #include #include -- cgit v1.2.3-59-g8ed1b From ff582680f8762293aa45eb5cf2faacadbe73b435 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Tue, 15 Jan 2013 17:02:19 +0900 Subject: tools lib traceevent: Fix warning on '>=' operator Although the '>=' (and '<=') operator is handled properly in libtraceevent, it emitted following spurious warnings on perf test: $ perf test 5: parse events tests : ... Warning: unknown op '>=' Warning: unknown op '>=' Warning: unknown op '>=' Warning: unknown op '>=' Warning: unknown op '>=' Warning: unknown op '>=' ... Add the operator to the checks. Signed-off-by: Namhyung Kim Acked-by: Steven Rostedt Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1358236939-17393-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/lib') diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index dc42e55469d1..f5046191d086 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -1784,6 +1784,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) strcmp(token, "/") == 0 || strcmp(token, "<") == 0 || strcmp(token, ">") == 0 || + strcmp(token, "<=") == 0 || + strcmp(token, ">=") == 0 || strcmp(token, "==") == 0 || strcmp(token, "!=") == 0) { -- cgit v1.2.3-59-g8ed1b From 10ee9fa3b92dece36209a3786d7bd558d459635f Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 18 Jan 2013 13:51:25 -0600 Subject: perf tools: Reinstate 'signed' field flag for tracepoints For some reason the libtraceevent tracepoint-parsing code is missing the FIELD_IS_SIGNED flag-setting code, which causes problems for the Perl trace event binding at least, since it ends up unable to recognize negative numbers. Things like checking for negative return values therefore fail, causing scripts like rwtop to instead interpret the negative return value as a large positive value, which in turn get added to e.g. read totals with insanely invalid results. So set the FIELD_IS_SIGNED flag for tracepoint events that specify "signed:1". Before: # perf script record rw-by-pid # perf script report rw-by-pid read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 753 Xorg 88 512000 7.74763251095801e+20 1619 firefox 42 462 2.58254417031934e+20 1232 gnome-shell 11 176 1.10680464442257e+20 1471 gnome-terminal 3 16366 18446744073709551615 1408 libsocialweb-co 2 32 18446744073709551613 After: # perf script report rw-by-pid read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 753 Xorg 88 512000 2764 1619 firefox 42 462 126 1232 gnome-shell 11 176 40 1471 gnome-terminal 3 16366 10 1408 libsocialweb-co 2 32 8 Signed-off-by: Tom Zanussi Link: http://lkml.kernel.org/r/1471b5968821a455cf5168bb4567964e74ecf530.1358527965.git.tom.zanussi@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/lib') diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index f5046191d086..bb8b3db0e583 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -1462,7 +1462,8 @@ static int event_read_fields(struct event_format *event, struct format_field **f if (read_expect_type(EVENT_ITEM, &token)) goto fail; - /* add signed type */ + if (strtoul(token, NULL, 0)) + field->flags |= FIELD_IS_SIGNED; free_token(token); if (read_expected(EVENT_OP, ";") < 0) -- cgit v1.2.3-59-g8ed1b