Skip to content

Commit

Permalink
Backport fe0402c8c6b74504468ed6a788bf80464bfef62a
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Jan 16, 2025
1 parent 195176a commit 116cdf1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/thapi/fix-lttng-array-types.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From fe0402c8c6b74504468ed6a788bf80464bfef62a Mon Sep 17 00:00:00 2001
From: Brice Videau <[email protected]>
Date: Mon, 1 Jul 2024 14:50:38 -0500
Subject: [PATCH] Fix LTTng array size types.

---
utils/meta_parameters.rb | 2 +-
utils/yaml_ast_lttng.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/meta_parameters.rb b/utils/meta_parameters.rb
index d0c217ed..2c3be8c7 100644
--- a/utils/meta_parameters.rb
+++ b/utils/meta_parameters.rb
@@ -217,7 +217,7 @@ def initialize(command, name, size)
size = "*#{size}"
size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type.type}"]
sz = sanitize_expression("#{size}", checks)
- st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type}"
+ st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type.type}"
else
checks = check_for_null("#{name}")
size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type}"]
diff --git a/utils/yaml_ast_lttng.rb b/utils/yaml_ast_lttng.rb
index acce44aa..6016dabc 100644
--- a/utils/yaml_ast_lttng.rb
+++ b/utils/yaml_ast_lttng.rb
@@ -184,6 +184,7 @@ def lttng_type(length: nil, length_type: nil)
ev.type = :uint8_t
if ev.length
ev.length = "(#{ev.length}) * sizeof(uint8_t)"
+ ev.length_type = "size_t"
end
when *OBJECT_TYPES, *POINTER_TYPES
ev.macro = :"ctf_#{lttng_arr_type}_hex"
@@ -202,6 +203,7 @@ def lttng_type(length: nil, length_type: nil)
ev.type = :uint8_t
if ev.length
ev.length = "(#{ev.length}) * sizeof(#{type.name})"
+ ev.length_type = "size_t"
end
else
super
2 changes: 2 additions & 0 deletions packages/thapi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class Thapi(AutotoolsPackage):

variant('strict', default=False, description='Enable -Werror during the build')
variant('mpi', default=False, description='Enable MPI support for the Sync Daemon')

patch('fix-lttng-array-types.patch', when='@0.0.8:0.0.11')
def configure_args(self):
args = []
args.extend(self.enable_or_disable('mpi'))
Expand Down

0 comments on commit 116cdf1

Please sign in to comment.