Skip to content

Commit

Permalink
bcc-probe: Allow running the helper from any path
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Mar 30, 2016
1 parent 74d2e6c commit a978401
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lua/bcc-probe
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

BPF.script_root(arg[1])
Expand Down

0 comments on commit a978401

Please sign in to comment.