Skip to content

Commit

Permalink
Minor fix (#139)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Applencourt <[email protected]>
  • Loading branch information
TApplencourt and Thomas Applencourt authored Aug 30, 2023
1 parent af54e73 commit 6e70092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions utils/babeltrace_thapi.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module BTComponentClassRefinement
refine(BT2::BTGraph) do
attr_accessor :plugins_path, :cli_v

def add_component(component_class, name, params: {},
def add(component_class, name, params: {},
logging_level: BT2::BTLogging.default_level,
initialize_method_data: nil)

Expand Down Expand Up @@ -219,7 +219,8 @@ def get_and_add_components(graph, names)
graph.add(comp, 'tally',
params: $options_tally.transform_values { |_, v| v })
else
graph.add(comp, name)
# `.` is not allowed in the babeltrace components name when using the CLI
graph.add(comp, name.gsub('.','_'))
end
end
end
Expand Down Expand Up @@ -344,10 +345,11 @@ connects(graph, comp)

if $options[:debug]
cli = graph.cli
name = "babeltrace_thapi_cli_#{command}.sh"
# puts cli
puts 'babeltrace_thapi: babeltrace2 cli command will be saved in ./babeltrace_thapi_cli.sh'
puts "babeltrace_thapi: babeltrace2 cli command will be saved in ./#{name}"
$stdout.flush
File.open('babeltrace_thapi_cli.sh', 'w') { |f| f.write(cli) }
File.open(name, 'w') { |f| f.write(cli) }
end

graph.run
8 changes: 4 additions & 4 deletions xprof/xprof.sh.erb.in
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,6 @@ trace_and_summary() {

call_babeltrace_thapi() {

local btt_debug_flag=$([ $debug == true ] && echo "--debug" || echo "")
local btt_common_flag="--backend <%= languages %> $btt_debug_flag"

if [ $mode == "tally" ] && [ $processing_mode == "post-process" ]; then
$bindir/babeltrace_thapi tally $btt_common_flag $bt_tally_argv -- $@
elif [ $mode == "tally" ] && [ $processing_mode == "on-the-fly" ]; then
Expand Down Expand Up @@ -500,7 +497,7 @@ summary() {

setup_babeltrace_live() {
mkdir -p $THAPI_LTTNG_O
$bindir/babeltrace_thapi live2aggreg --backend <%= languages %> \
$bindir/babeltrace_thapi live2aggreg $btt_common_flag \
--inputs "net://localhost/host/$(hostname)/THAPI_$(hostname)" \
--output $THAPI_LTTNG_O &
BT_PID=$!
Expand Down Expand Up @@ -585,6 +582,9 @@ while (( "$#" )); do
esac
done

btt_debug_flag=$([ $debug == true ] && echo "--debug" || echo "")
btt_common_flag="--backend <%= languages %> $btt_debug_flag"

quiet=""
if [ $debug = true ]; then
PS4="RankID $(mpi_rank_id): "
Expand Down

0 comments on commit 6e70092

Please sign in to comment.