X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Futils%2Fparse-callstack.py;h=c3f0e2e9bc5a5d5278cb650cd09abbd5b9f8af38;hb=5a23e035fd978f4623b818d45a47ef89bc354579;hp=da0bab626e5d736b9a29c4a8c11c5fa28567e196;hpb=591ee332c58988222f58c6eadb047890707e7a35;p=lttng-tools.git diff --git a/tests/utils/parse-callstack.py b/tests/utils/parse-callstack.py index da0bab626..c3f0e2e9b 100755 --- a/tests/utils/parse-callstack.py +++ b/tests/utils/parse-callstack.py @@ -1,19 +1,9 @@ -#! /usr/bin/python3 - -# Copyright (C) - 2017 Francis Deslauriers +#!/usr/bin/env python3 # -# This library 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. +# Copyright (C) 2017 Francis Deslauriers # -# This library 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. +# SPDX-License-Identifier: LGPL-2.1-only # -# You should have received a copy of the GNU Lesser General Public License -# along with this library; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import sys import bisect @@ -34,7 +24,9 @@ def addr2line(executable, addr): # Expand inlined functions cmd += ['--addresses', addr] - addr2line_output = subprocess.getoutput(' '.join(cmd)) + status = subprocess.run(cmd, stdout=subprocess.PIPE, check=True) + + addr2line_output = status.stdout.decode("utf-8") # Omit the last 2 lines as the caller of main can not be determine fcts = [addr2line_output.split()[-2]]