tasks/system_probe.py
def nettop(ctx, incremental_build=False, go_mod="mod", parallel_build=True):
    """
    Build and run the `nettop` utility for testing
    """
    build_object_files(ctx, parallel_build=parallel_build)

    cmd = 'go build -mod={go_mod} {build_type} -tags {tags} -o {bin_path} {path}'
    bin_path = os.path.join(BIN_DIR, "nettop")
    # Build
    ctx.run(
        cmd.format(
            path=os.path.join(REPO_PATH, "pkg", "network", "nettop"),
            bin_path=bin_path,
            go_mod=go_mod,
            build_type="" if incremental_build else "-a",
            tags=BPF_TAG,
        )
    )

    # Run
    if not is_root():
        ctx.sudo(bin_path)
    else:
        ctx.run(bin_path)

    Build and run the `nettop` utility for testing
    
Build and run the `nettop` utility for testing
Build and run the ` nettop ` utility for testing
def nettop(ctx, incremental_build=False, go_mod="mod", parallel_build=True):
    build_object_files(ctx, parallel_build=parallel_build)
    cmd = 'go build -mod={go_mod} {build_type} -tags {tags} -o {bin_path} {path}'
    bin_path = os.path.join(BIN_DIR, "nettop")
    ctx.run(
        cmd.format(
            path=os.path.join(REPO_PATH, "pkg", "network", "nettop"),
            bin_path=bin_path,
            go_mod=go_mod,
            build_type="" if incremental_build else "-a",
            tags=BPF_TAG,
        )
    )
    if not is_root():
        ctx.sudo(bin_path)
    else:
        ctx.run(bin_path)
def nettop ( ctx , incremental_build = False , go_mod = "mod" , parallel_build = True ) : build_object_files ( ctx , parallel_build = parallel_build ) cmd = 'go build -mod={go_mod} {build_type} -tags {tags} -o {bin_path} {path}' bin_path = os . path . join ( BIN_DIR , "nettop" ) ctx . run ( cmd . format ( path = os . path . join ( REPO_PATH , "pkg" , "network" , "nettop" ) , bin_path = bin_path , go_mod = go_mod , build_type = "" if incremental_build else "-a" , tags = BPF_TAG , ) ) if not is_root ( ) : ctx . sudo ( bin_path ) else : ctx . run ( bin_path )
Build and run the `nettop` utility for testing
Build and run the ` nettop ` utility for testing
"""
    Build and run the `nettop` utility for testing
    """ # Build # Run
ctx
incremental_build
go_mod
parallel_build