From 28a4c3fd40a11da21260d3a6b7c27768181b7ee7 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 23 Apr 2019 12:03:26 -0300 Subject: [PATCH] Add fixes to problems found by koji Signed-off-by: Arnaldo Carvalho de Melo --- dwarves-1.13-spec-fixes.patch | 94 +++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/dwarves-1.13-spec-fixes.patch b/dwarves-1.13-spec-fixes.patch index 106ce81..9434c0e 100644 --- a/dwarves-1.13-spec-fixes.patch +++ b/dwarves-1.13-spec-fixes.patch @@ -11,6 +11,100 @@ index e2c0ee107940..88a364febaf2 100644 DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/) install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/) install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +diff --git a/ostra/ostra-cg b/ostra/ostra-cg +index 0f4009a24558..52c902e24869 100755 +--- a/ostra/ostra-cg ++++ b/ostra/ostra-cg +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # ostra-cg - generate callgraphs from encoded trace + # + # Arnaldo Carvalho de Melo +@@ -386,7 +386,7 @@ def method_stats(class_def, callgraph): + + if __name__ == '__main__': + if len(sys.argv) not in [ 3, 4 ]: +- print "usage: ostra-cg [object]" ++ print("usage: ostra-cg [object]") + sys.exit(1) + + gen_html = True +@@ -402,9 +402,9 @@ if __name__ == '__main__': + class_def = ostra.class_definition(class_def_file = "%s.fields" % traced_class, + class_methods_file = "%s.functions" % traced_class) + new_callgraph_file(traced_class) +- class_def.parse_file(encoded_trace, verbose = verbose, +- process_record = process_record, +- my_object = my_object) ++ class_def.parse_file(encoded_trace, verbose = verbose, ++ process_record = process_record, ++ my_object = my_object) + if gen_html: + print_where_fields_changed() + close_callgraph_file() +diff --git a/ostra/python/ostra.py b/ostra/python/ostra.py +index dd240ae1a180..86fe07947a5d 100755 +--- a/ostra/python/ostra.py ++++ b/ostra/python/ostra.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # + # Copyright (C) 2005, 2006, 2007 Arnaldo Carvalho de Melo + # +@@ -206,7 +206,7 @@ class class_definition: + break + if verbose: + nr_lines += 1 +- print "\r%d" % nr_lines, ++ print("\r%d" % nr_lines,) + + self.parse_record(line) + +@@ -245,8 +245,8 @@ class class_definition: + continue + + if verbose: +- print "plot_methods: plotting %s method (%d samples)" % \ +- (current_method.name, nr_samples) ++ print("plot_methods: plotting %s method (%d samples)" % \ ++ (current_method.name, nr_samples)) + + entries = [float("%d.0" % entry) for entry in range(nr_samples)] + samples = current_method.times +@@ -323,11 +323,11 @@ def plot_field(name, directory, tstamps, samples, nr_samples, plot_fmt = None, + if current_plot_fmt == "filter_dev": + std = std_deviation(samples) * 2 + if verbose: +- print "filter_dev(%s) std=%d" % (name, std) ++ print("filter_dev(%s) std=%d" % (name, std)) + for i in range(nr_samples): + if samples[i] > std: + if verbose: +- print "%s: filtering out %d" % (name, samples[i]) ++ print("%s: filtering out %d" % (name, samples[i])) + samples[i] = 0 + field_mean = mean(samples) + yaxis_plot_fmt = FuncFormatter(pylab_formatter) +@@ -376,7 +376,7 @@ def plot(class_def, callgraph, verbose = False): + continue + + if verbose: +- print "ostra-plot: plotting %s field (%d samples)" % (current_field.name, nr_samples) ++ print("ostra-plot: plotting %s field (%d samples)" % (current_field.name, nr_samples)) + + tstamps = [float("%d.%06d" % (entry.tstamp.seconds, entry.tstamp.microseconds)) \ + for entry in current_field.changes] +@@ -392,6 +392,6 @@ if __name__ == '__main__': + import sys + c = class_definition(sys.argv[1], sys.argv[2]) + for field in c.fields.values(): +- print "%s: %s" % (field, field.table) ++ print("%s: %s" % (field, field.table)) + for method in c.methods.values(): +- print "%d: %s" % (method.function_id, method.name) ++ print("%d: %s" % (method.function_id, method.name)) diff --git a/rpm/SPECS/dwarves.spec b/rpm/SPECS/dwarves.spec index 5d8f60879afa..be2c29f3792c 100644 --- a/rpm/SPECS/dwarves.spec