Patch "perf time-utils: Fix 32-bit nsec parsing" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf time-utils: Fix 32-bit nsec parsing

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-time-utils-fix-32-bit-nsec-parsing.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d7f1f19bc944cbdd51f5dbaa100e38b3416b3c44
Author: Ian Rogers <irogers@xxxxxxxxxx>
Date:   Sat Aug 31 00:04:11 2024 -0700

    perf time-utils: Fix 32-bit nsec parsing
    
    [ Upstream commit 38e2648a81204c9fc5b4c87a8ffce93a6ed91b65 ]
    
    The "time utils" test fails in 32-bit builds:
      ...
      parse_nsec_time("18446744073.709551615")
      Failed. ptime 4294967295709551615 expected 18446744073709551615
      ...
    
    Switch strtoul to strtoull as an unsigned long in 32-bit build isn't
    64-bits.
    
    Fixes: c284d669a20d408b ("perf tools: Move parse_nsec_time to time-utils.c")
    Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
    Cc: Chaitanya S Prakash <chaitanyas.prakash@xxxxxxx>
    Cc: Colin Ian King <colin.i.king@xxxxxxxxx>
    Cc: David Ahern <dsa@xxxxxxxxxxxxxxxxxxx>
    Cc: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: James Clark <james.clark@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: John Garry <john.g.garry@xxxxxxxxxx>
    Cc: Junhao He <hejunhao3@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Yang Jihong <yangjihong@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240831070415.506194-3-irogers@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 6193b46050a56..540a71450de52 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -17,7 +17,7 @@ int parse_nsec_time(const char *str, u64 *ptime)
 	u64 time_sec, time_nsec;
 	char *end;
 
-	time_sec = strtoul(str, &end, 10);
+	time_sec = strtoull(str, &end, 10);
 	if (*end != '.' && *end != '\0')
 		return -1;
 
@@ -35,7 +35,7 @@ int parse_nsec_time(const char *str, u64 *ptime)
 		for (i = strlen(nsec_buf); i < 9; i++)
 			nsec_buf[i] = '0';
 
-		time_nsec = strtoul(nsec_buf, &end, 10);
+		time_nsec = strtoull(nsec_buf, &end, 10);
 		if (*end != '\0')
 			return -1;
 	} else




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux