Skip to content

Commit

Permalink
build(api): configure list of API operations for TC BPF programs
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido committed May 27, 2022
1 parent 27de573 commit d7c59a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xmake/modules/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function gen(target, source_target)
local tempconf = path.join(os.tmpdir(), confname)
os.tryrm(tempconf)
os.cp(configfile_template_path, tempconf)
target:add("configfiles", tempconf, { variables = { PROGNAME = progname } })
target:add("configfiles", tempconf, { variables = { PROGNAME = progname, OPERATION = "attach__" } })
end
end

Expand All @@ -49,15 +49,18 @@ function main(target, components_target, banner)
local num_components = #components
v["PROGRAMS_COUNT"] = num_components + 1

local op = vars[1].variables.OPERATION
v["OPERATION"] = op

local programs = {}
table.insert(programs, "0")
for _, v in ipairs(vars) do
table.insert(programs, v.variables.PROGNAME)
utils.dump(v.variables)
end
table.sort(programs)
v["PROGRAMS_AS_SYMBOLS"] = 'program_' .. table.concat(programs, ", program_")
v["PROGRAMS_AS_STRINGS"] = '"' .. table.concat(programs, '", "') .. '"'
v["PROGRAMS_OPS_AS_SYMBOLS"] = op .. table.concat(programs, ', ' .. op)
table.remove(programs, 1)
v["PROGRAMS_DESCRIPTION"] = '" - ' .. table.concat(programs, '\\n - ') .. '"'

Expand Down

0 comments on commit d7c59a1

Please sign in to comment.