Skip to content

Commit

Permalink
Fix pgrep flag for Golang profiling (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeNFed authored Jan 14, 2021
1 parent cb72901 commit 7d48510
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions cli/cmd/kubernetes/job/bpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ func (b *bpfCreator) create(targetPod *apiv1.Pod, cfg *data.FlameConfig) (string
imageName = fmt.Sprintf("%s:%s-bpf", baseImageName, version.GetCurrent())
}

args := []string{
id, string(targetPod.UID),
cfg.TargetConfig.ContainerName, cfg.TargetConfig.ContainerId,
cfg.TargetConfig.Duration.String(), string(cfg.TargetConfig.Language),
string(cfg.TargetConfig.Event),
}

if cfg.TargetConfig.Pgrep != "" {
args = append(args, cfg.TargetConfig.Pgrep)
}

commonMeta := metav1.ObjectMeta{
Name: fmt.Sprintf("kubectl-flame-%s", id),
Namespace: cfg.TargetConfig.Namespace,
Expand Down Expand Up @@ -80,15 +91,7 @@ func (b *bpfCreator) create(targetPod *apiv1.Pod, cfg *data.FlameConfig) (string
Name: ContainerName,
Image: imageName,
Command: []string{"/app/agent"},
Args: []string{
id,
string(targetPod.UID),
cfg.TargetConfig.ContainerName,
cfg.TargetConfig.ContainerId,
cfg.TargetConfig.Duration.String(),
string(cfg.TargetConfig.Language),
cfg.TargetConfig.Pgrep,
},
Args: args,
VolumeMounts: []apiv1.VolumeMount{
{
Name: "sys",
Expand Down

0 comments on commit 7d48510

Please sign in to comment.