Commit a978401e authored by Vicent Marti's avatar Vicent Marti

bcc-probe: Allow running the helper from any path

parent 74d2e6cd
...@@ -14,9 +14,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -14,9 +14,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
]] ]]
package.path = "./?/init.lua;"..package.path function setup_path()
local str = require("debug").getinfo(2, "S").source:sub(2)
local script_path = str:match("(.*/)").."/?.lua;"
package.path = script_path..package.path
end
local BCC = require("bcc") setup_path()
local BCC = require("bcc.init")
local BPF = BCC.BPF local BPF = BCC.BPF
BPF.script_root(arg[1]) BPF.script_root(arg[1])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment