#!/usr/bin/env ruby
# Original hello_world.py:
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# This Ruby version follows the Apache License 2.0

# run in project examples directory with:
# sudo ./hello_world.rb"
# see trace_fields.rb for a longer example

require "rbbcc"
include RbBCC

# This may not work for 4.17 on x64, you need replace kprobe__sys_clone with kprobe____x64_sys_clone
BCC.new(text: 'int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print
