Skip to content

Commit

Permalink
Add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Applencourt committed Nov 7, 2023
1 parent 0b6fc7e commit b1aff68
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
27 changes: 14 additions & 13 deletions utils/babeltrace_to_metababel_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@

require 'yaml'

HIP_STRUCT_TYPES = [
'struct hipChannelFormatDesc',
'struct hipExtent',
'hipIpcMemHandle_t',
'hipIpcEventHandle_t',
'hipPitchedPtr',
'hipExtent',
'dim3',
]
raise "Not input model provided" unless ARGV.length > 0
input_model_path = ARGV[0]
model = YAML.load_file(input_model_path)


# Just look in the payload, good enough for now
HIP_STRUCT_TYPES = model[:event_classes].map { |f|
f[:payload].filter_map { |l|
native = l[:class]
cast = l[:cast_type]

cast if native == "string" and cast != "char *" and !cast.include?("*")
}
}.flatten.uniq

PROPERTIES_DICT = {
:class => :type
Expand Down Expand Up @@ -114,10 +119,6 @@ def get_environment_entry(entry)
{ :name => entry[:name], :type => entry[:class] }
end

raise "Not input model provided" unless ARGV.length > 0
input_model_path = ARGV[0]
model = YAML.load_file(input_model_path)

# THAPI interval and HIP model differ.
if model.key?(:stream_classes)
stream_class = model.delete(:stream_classes).pop
Expand Down
1 change: 1 addition & 0 deletions ze/babeltrace_zeprofiling_apis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lttng_ust_ze:zeCommandListCreate_entry,lttng_ust_ze:zeCommandListCreate_exit,lttng_ust_ze:zeCommandListCreateImmediate_entry,lttng_ust_ze:zeCommandListCreateImmediate_exit,lttng_ust_ze:zeCommandListAppendWriteGlobalTimestamp_entry,lttng_ust_ze:zeCommandListAppendWriteGlobalTimestamp_exit,lttng_ust_ze:zeCommandListAppendBarrier_entry,lttng_ust_ze:zeCommandListAppendBarrier_exit,lttng_ust_ze:zeCommandListAppendMemoryRangesBarrier_entry,lttng_ust_ze:zeCommandListAppendMemoryRangesBarrier_exit,lttng_ust_ze:zeCommandListAppendMemoryCopy_entry,lttng_ust_ze:zeCommandListAppendMemoryCopy_exit,lttng_ust_ze:zeCommandListAppendMemoryFill_entry,lttng_ust_ze:zeCommandListAppendMemoryFill_exit,lttng_ust_ze:zeCommandListAppendMemoryCopyRegion_entry,lttng_ust_ze:zeCommandListAppendMemoryCopyRegion_exit,lttng_ust_ze:zeCommandListAppendMemoryCopyFromContext_entry,lttng_ust_ze:zeCommandListAppendMemoryCopyFromContext_exit,lttng_ust_ze:zeCommandListAppendImageCopy_entry,lttng_ust_ze:zeCommandListAppendImageCopy_exit,lttng_ust_ze:zeCommandListAppendImageCopyRegion_entry,lttng_ust_ze:zeCommandListAppendImageCopyRegion_exit,lttng_ust_ze:zeCommandListAppendImageCopyToMemory_entry,lttng_ust_ze:zeCommandListAppendImageCopyToMemory_exit,lttng_ust_ze:zeCommandListAppendImageCopyFromMemory_entry,lttng_ust_ze:zeCommandListAppendImageCopyFromMemory_exit,lttng_ust_ze:zeCommandListAppendSignalEvent_entry,lttng_ust_ze:zeCommandListAppendSignalEvent_exit,lttng_ust_ze:zeCommandListAppendQueryKernelTimestamps_entry,lttng_ust_ze:zeCommandListAppendQueryKernelTimestamps_exit,lttng_ust_ze:zeMemAllocShared_entry,lttng_ust_ze:zeMemAllocShared_exit,lttng_ust_ze:zeMemAllocDevice_entry,lttng_ust_ze:zeMemAllocDevice_exit,lttng_ust_ze:zeMemAllocHost_entry,lttng_ust_ze:zeMemAllocHost_exit,lttng_ust_ze:zeMemFree_entry,lttng_ust_ze:zeMemFree_exit,lttng_ust_ze:zeModuleCreate_entry,lttng_ust_ze:zeModuleCreate_exit,lttng_ust_ze:zeModuleDestroy_entry,lttng_ust_ze:zeModuleDestroy_exit,lttng_ust_ze:zeModuleGetGlobalPointer_entry,lttng_ust_ze:zeModuleGetGlobalPointer_exit,lttng_ust_ze:zeKernelCreate_entry,lttng_ust_ze:zeKernelCreate_exit,lttng_ust_ze:zeCommandListAppendLaunchKernel_entry,lttng_ust_ze:zeCommandListAppendLaunchKernel_exit,lttng_ust_ze:zeCommandListAppendLaunchCooperativeKernel_entry,lttng_ust_ze:zeCommandListAppendLaunchCooperativeKernel_exit,lttng_ust_ze:zeCommandListAppendLaunchKernelIndirect_entry,lttng_ust_ze:zeCommandListAppendLaunchKernelIndirect_exit,lttng_ust_ze:zeCommandListAppendLaunchMultipleKernelsIndirect_entry,lttng_ust_ze:zeCommandListAppendLaunchMultipleKernelsIndirect_exit,lttng_ust_ze:zeCommandListAppendImageCopyToMemoryExt_entry,lttng_ust_ze:zeCommandListAppendImageCopyToMemoryExt_exit,lttng_ust_ze:zeCommandListAppendImageCopyFromMemoryExt_entry,lttng_ust_ze:zeCommandListAppendImageCopyFromMemoryExt_exit,lttng_ust_zet:zetCommandListAppendMetricQueryEnd_entry,lttng_ust_zet:zetCommandListAppendMetricQueryEnd_exit,lttng_ust_ze_profiling:event_profiling,lttng_ust_ze_profiling:event_profiling_results,lttng_ust_ze_properties:device,lttng_ust_ze_properties:subdevice
45 changes: 44 additions & 1 deletion ze/gen_babeltrace_ze_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,48 @@ def gen_struct_event_bt_model(provider, struct)
}
}.flatten

puts YAML.dump({ name: "thapi_ze", event_classes: event_classes })

environment = [
{
name: 'hostname',
class: 'string',
}
]

packet_context = [
{
name: 'cpu_id',
class: 'unsigned',
cast_type: 'uint64_t',
class_properties: {
field_value_range: 32
}
}
]

common_context = [
{
name: 'vpid',
class: 'signed',
cast_type: 'int64_t',
class_properties: {
field_value_range: 64,
}
},
{
name: 'vtid',
class: 'unsigned',
cast_type: 'uint64_t',
class_properties: {
field_value_range: 64,
}
}
]

puts YAML.dump({
name: "thapi_ze",
environment: environment,
clock_snapshot_value: true,
packet_context: packet_context,
common_context: common_context,
event_classes: event_classes })

0 comments on commit b1aff68

Please sign in to comment.