rbbcc 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca8253cb2fb2d8bd3824d294d54f13d5e34a9326d25244ce7ea4d4fddc202978
4
- data.tar.gz: 71796d5a508760ed617347d2275f30e90fb9a8b9d68354aba884b33d4625cd3e
3
+ metadata.gz: 92b4487b6e8f5b72aad25113da967b51b2feb064361676b093441b6fd0bab672
4
+ data.tar.gz: 03d71e58ddebacdbf41f0c1ad4422bcfa1b9acdda3ac568068a2a8751b594a97
5
5
  SHA512:
6
- metadata.gz: b36369cea2736423e7722b8cf087460b3966d0f73b6b9579b98aba643e0c4f6eef3bcd0f0089d0f25da61df3b2b612165ad8d1d25911511138b4b228eb94a6e5
7
- data.tar.gz: 6e8047c3928dd676218a88c618c8546ae20de8a499acd6d700df0d0a1f4363fbee26cb168fd1190de879f939a57fc4a43cfaa453cecf50c52c0ab105f080b04f
6
+ metadata.gz: bb9234154fe245bf001676f1a6e7b1e5bcce31e4962bd0d646746d1f3c286722def93899877c9a200a516fd33366ef7c73fcf2a7a22731fb76225edb5477f449
7
+ data.tar.gz: 89415cbd8cadade4b49b53b5fd1c024198bfbd3424e0d95ecaf8e00381495570e171bcf54f4c395ddf40d762821da1425945761d80166aef724e038f43ae0f3c
data/Gemfile CHANGED
@@ -10,6 +10,7 @@ gem "minitest", ">= 5"
10
10
 
11
11
  group :omnibus_package do
12
12
  gem "appbundler"
13
+ gem "specific_install"
13
14
  end
14
15
 
15
16
  group :plugin_dev do
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- rbbcc (0.6.3)
11
+ rbbcc (0.6.4)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
@@ -27,6 +27,7 @@ GEM
27
27
  coderay (~> 1.1)
28
28
  method_source (~> 1.0)
29
29
  rake (13.0.1)
30
+ specific_install (0.3.5)
30
31
 
31
32
  PLATFORMS
32
33
  ruby
@@ -39,6 +40,7 @@ DEPENDENCIES
39
40
  rake (~> 13.0)
40
41
  rbbcc!
41
42
  rbbcc-hello!
43
+ specific_install
42
44
 
43
45
  BUNDLED WITH
44
46
  2.1.4
@@ -220,7 +220,7 @@ module RbBCC
220
220
  end
221
221
  end
222
222
 
223
- def initialize(text: "", src_file: nil, hdr_file: nil, debug: 0, cflags: [], usdt_contexts: [], allow_rlimit: 0)
223
+ def initialize(text: "", src_file: nil, hdr_file: nil, debug: 0, cflags: [], usdt_contexts: [], allow_rlimit: 0, dev_name: nil)
224
224
  @kprobe_fds = {}
225
225
  @uprobe_fds = {}
226
226
  @tracepoint_fds = {}
@@ -232,7 +232,7 @@ module RbBCC
232
232
  end
233
233
 
234
234
  if src_file && src_file.end_with?(".b")
235
- @module = Clib.bpf_module_create_b(src_file, hdr_file, debug, device)
235
+ @module = Clib.bpf_module_create_b(src_file, hdr_file, debug, dev_name)
236
236
  else
237
237
  if src_file
238
238
  text = File.read(src_file)
@@ -250,12 +250,13 @@ module RbBCC
250
250
  cflags
251
251
  end
252
252
 
253
- @module = Clib.bpf_module_create_c_from_string(
253
+ @module = Clib.do_bpf_module_create_c_from_string(
254
254
  text,
255
255
  debug,
256
256
  cflags_safe.pack("p*"),
257
257
  cflags_safe.size,
258
- allow_rlimit
258
+ allow_rlimit,
259
+ dev_name
259
260
  )
260
261
  end
261
262
  @funcs = {}
@@ -44,24 +44,38 @@ module RbBCC
44
44
  end
45
45
  typealias "size_t", "int"
46
46
 
47
- extern 'void * bpf_module_create_c_from_string(char *, unsigned int, char **, int, long)'
48
47
  extern 'void * bpf_module_create_b(char *filename, char *proto_filename, unsigned int flags, char *dev_name)'
49
48
  extern 'int bpf_num_functions(void *)'
50
49
  extern 'char * bpf_function_name(void *, int)'
51
50
  extern 'void bpf_module_destroy(void *)'
52
51
 
53
52
  if libbcc_version_gteq?("0.11.0")
53
+ extern 'void * bpf_module_create_c_from_string(
54
+ const char *text, unsigned int flags, const char *cflags[],
55
+ int ncflags, int allow_rlimit,
56
+ const char *dev_name)'
54
57
  extern 'int bcc_func_load(
55
58
  void *program, int prog_type, const char *name,
56
59
  const struct bpf_insn *insns, int prog_len,
57
60
  const char *license, unsigned int kern_version,
58
61
  int log_level, char *log_buf, unsigned int log_buf_size,
59
62
  const char *dev_name)'
63
+ def self.do_bpf_module_create_c_from_string(text, flags, cflags, ncflags, allow_limit, dev_name)
64
+ bpf_module_create_c_from_string(text, flags, cflags, ncflags, allow_limit, dev_name)
65
+ end
66
+
60
67
  def self.do_bcc_func_load(mod, prog_type, name, insns, len, license, kver, loglv, buf, buf_size, device)
61
68
  bcc_func_load(mod, prog_type, name, insns, len, license, kver, loglv, buf, buf_size, device)
62
69
  end
63
70
  else
71
+ extern 'void * bpf_module_create_c_from_string(
72
+ const char *text, unsigned int flags, const char *cflags[],
73
+ int ncflags, int allow_rlimit)'
64
74
  extern 'int bcc_func_load(void *, int, char *, void *, int, char *, unsigned int, int, char *, unsigned int)'
75
+ def self.do_bpf_module_create_c_from_string(text, flags, cflags, ncflags, allow_limit, dev_name=nil)
76
+ bpf_module_create_c_from_string(text, flags, cflags, ncflags, allow_limit)
77
+ end
78
+
65
79
  def self.do_bcc_func_load(mod, prog_type, name, insns, len, license, kver, loglv, buf, buf_size, device)
66
80
  bcc_func_load(mod, prog_type, name, insns, len, license, kver, loglv, buf, buf_size)
67
81
  end
@@ -1,3 +1,3 @@
1
1
  module RbBCC
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbcc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio Kondo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-20 00:00:00.000000000 Z
11
+ date: 2020-11-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: BCC port for MRI. See https://github.com/iovisor/bcc
14
14
  email: