Skip to content

Commit

Permalink
user : remove unused flag nosearch .
Browse files Browse the repository at this point in the history
Set the default `--map-size` to 5120KB.

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Dec 2, 2023
1 parent cc75615 commit 4625226
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
6 changes: 0 additions & 6 deletions cli/cmd/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type GlobalFlags struct {
Debug bool
Pid uint64 // PID
Uid uint64 // UID
NoSearch bool // No lib search
LoggerAddr string // save file
mapSizeKB int // ebpf map size per CPU
addrType uint8 // 0:stdout, 1:file, 2:tcp
Expand Down Expand Up @@ -64,11 +63,6 @@ func getGlobalConf(command *cobra.Command) (conf GlobalFlags, err error) {
return
}

conf.NoSearch, err = command.Flags().GetBool("nosearch")
if err != nil {
return
}

conf.mapSizeKB, err = command.Flags().GetInt("map-size")
if err != nil {
return
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/gotls.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func goTLSCommandFunc(command *cobra.Command, args []string) {
conf.SetDebug(gConf.Debug)
conf.SetHex(gConf.IsHex)
conf.SetPerCpuMapSize(gConf.mapSizeKB)
//conf.SetNoSearch(gConf.NoSearch)

err = conf.Check()

Expand Down
5 changes: 2 additions & 3 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ func init() {
// Cobra also supports local flags, which will only run
// when this action is called directly.
//rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.PersistentFlags().BoolVarP(&globalFlags.Debug, "debug", "d", false, "enable debug logging")
rootCmd.PersistentFlags().BoolVarP(&globalFlags.Debug, "debug", "d", false, "enable debug logging.(coming soon)")
rootCmd.PersistentFlags().BoolVar(&globalFlags.IsHex, "hex", false, "print byte strings as hex encoded strings")
rootCmd.PersistentFlags().BoolVar(&globalFlags.NoSearch, "nosearch", false, "no lib search")
rootCmd.PersistentFlags().IntVar(&globalFlags.mapSizeKB, "map-size", 10240, "eBPF map size per CPU,for events buffer. default:10240. (KB)")
rootCmd.PersistentFlags().IntVar(&globalFlags.mapSizeKB, "map-size", 1024*5, "eBPF map size per CPU,for events buffer. default:5120. (KB)")
rootCmd.PersistentFlags().Uint64VarP(&globalFlags.Pid, "pid", "p", defaultPid, "if pid is 0 then we target all pids")
rootCmd.PersistentFlags().Uint64VarP(&globalFlags.Uid, "uid", "u", defaultUid, "if uid is 0 then we target all users")
rootCmd.PersistentFlags().StringVarP(&globalFlags.LoggerAddr, "log-addr", "l", "", "-l /tmp/ecapture.log or -l tcp://127.0.0.1:8080")
Expand Down
4 changes: 4 additions & 0 deletions user/config/common_androidgki.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

package config

import (
"os"
)

// https://source.android.com/devices/architecture/vndk/linker-namespace
var (
default_so_paths = []string{
Expand Down
5 changes: 0 additions & 5 deletions user/config/config_nspr_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ func (nc *NsprConfig) Check() error {
return nil
}
/*
if nc.NoSearch {
return errors.New("NoSearch requires specifying lib path")
}
//如果配置 Curlpath的地址,判断文件是否存在,不存在则直接返回
if nc.Firefoxpath != "" || len(strings.TrimSpace(nc.Firefoxpath)) > 0 {
_, e := os.Stat(nc.Firefoxpath)
Expand Down

0 comments on commit 4625226

Please sign in to comment.