Skip to content

Commit

Permalink
tetra: add max-recv-size to processcache dump cmd
Browse files Browse the repository at this point in the history
When dumping a full process cache (around 65K entries) the gRPC client
could not handle a response of this size. This makes it possible to
configure it on demand if needed.

Signed-off-by: Mahe Tardy <[email protected]>
  • Loading branch information
mtardy committed Sep 13, 2024
1 parent 8b2aa36 commit 69ea3f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/tetra/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/cilium/tetragon/pkg/sensors/base"
"github.com/cilium/tetragon/pkg/sensors/exec/execvemap"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)

func New() *cobra.Command {
Expand Down Expand Up @@ -106,6 +107,7 @@ func dumpExecveMap(fname string) {

func dumpProcessCache() *cobra.Command {
skipZeroRefcnt := false
var maxCallRecvMsgSize int

ret := &cobra.Command{
Use: "processcache",
Expand All @@ -127,7 +129,7 @@ func dumpProcessCache() *cobra.Command {
},
},
}
res, err := c.Client.GetDebug(c.Ctx, &req)
res, err := c.Client.GetDebug(c.Ctx, &req, grpc.MaxCallRecvMsgSize(maxCallRecvMsgSize))
if err != nil {
return fmt.Errorf("failed to get process dump debug info: %w", err)
}
Expand All @@ -150,6 +152,7 @@ func dumpProcessCache() *cobra.Command {

flags := ret.Flags()
flags.BoolVar(&skipZeroRefcnt, "skip-zero-refcnt", skipZeroRefcnt, "skip entries with zero refcnt")
flags.IntVar(&maxCallRecvMsgSize, "max-recv-size", 4194304, "The maximum message size in bytes the client can receive. Default is gRPC 4MB default.")

return ret
}
Expand Down

0 comments on commit 69ea3f8

Please sign in to comment.