kezhenxu94 commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-rover/pull/7#discussion_r830740275



##########
File path: pkg/profiling/task/oncpu/runner.go
##########
@@ -0,0 +1,311 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, 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.
+
+//go:build linux
+
+package oncpu
+
+import (
+       "bytes"
+       "context"
+       "encoding/binary"
+       "errors"
+       "fmt"
+       "math"
+       "os"
+       "runtime"
+       "sync"
+       "time"
+
+       "github.com/cilium/ebpf"
+       "github.com/cilium/ebpf/perf"
+
+       "github.com/hashicorp/go-multierror"
+
+       "github.com/apache/skywalking-rover/pkg/logger"
+       "github.com/apache/skywalking-rover/pkg/process/api"
+       "github.com/apache/skywalking-rover/pkg/profiling/task/base"
+       "github.com/apache/skywalking-rover/pkg/tools"
+       "github.com/apache/skywalking-rover/pkg/tools/profiling"
+
+       "golang.org/x/sys/unix"
+
+       v3 "skywalking.apache.org/repo/goapi/collect/ebpf/profiling/v3"
+)
+
+// $BPF_CLANG and $BPF_CFLAGS are set by the Makefile.
+// nolint
+//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc $BPF_CLANG -cflags 
$BPF_CFLAGS bpf $REPO_ROOT/bpf/profiling/oncpu.c -- -I$REPO_ROOT/bpf/include

Review comment:
       You set `REPO_ROOT` with an absolute path in the makefile as `export 
REPO_ROOT := /skywalking-rover`, this works in `make container-generate` 
because you mount the repo to `/skywalking-rover` in the container but it 
mostly will fail in others' machines (like mine), I have to put the repo in 
`/skywalking-rover` which is unrealistic. Why not consider using relative path? 
Or, if we cannot run all the commands in non-Linux machines, I'd rather not to 
have the `generate` command at all, just use `container-generate` and run all 
commands in containers.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to