From: vitalyr@chromium.org Date: Wed, 29 Jun 2011 15:34:00 +0000 (+0000) Subject: ll_prof: Terminate mmap file names on the first NUL char. X-Git-Tag: upstream/4.7.83~19034 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=150cc3fc33e46c9cf5caea1b534bfe54affd9984;p=platform%2Fupstream%2Fv8.git ll_prof: Terminate mmap file names on the first NUL char. R=fschneider@chromium.org Review URL: http://codereview.chromium.org/7282011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/tools/ll_prof.py b/tools/ll_prof.py index 798b57493..58cbb9585 100755 --- a/tools/ll_prof.py +++ b/tools/ll_prof.py @@ -631,10 +631,10 @@ class TraceReader(object): def ReadMmap(self, header, offset): mmap_info = PERF_MMAP_EVENT_BODY_DESC.Read(self.trace, offset + self.header_size) - # Read null-padded filename. + # Read null-terminated filename. filename = self.trace[offset + self.header_size + ctypes.sizeof(mmap_info): - offset + header.size].rstrip(chr(0)) - mmap_info.filename = filename + offset + header.size] + mmap_info.filename = filename[:filename.find(chr(0))] return mmap_info def ReadSample(self, header, offset):