@@ -78,6 +78,19 @@ func persistentPreRunEFunc(command *cobra.Command, args []string) error {
7878 target_config .Pid = global_config .Pid
7979 }
8080
81+ target_config .TidBlacklistMask = 0
82+ if global_config .TidsBlacklist != "" {
83+ tids := strings .Split (global_config .TidsBlacklist , "," )
84+ if len (tids ) > 5 {
85+ return fmt .Errorf ("max tid blacklist count is 5, provided count:%d" , len (tids ))
86+ }
87+ for i , v := range tids {
88+ value , _ := strconv .ParseUint (v , 10 , 32 )
89+ target_config .TidBlacklist [i ] = uint32 (value )
90+ target_config .TidBlacklistMask |= (1 << i )
91+ }
92+ }
93+
8194 // 第二步 通过包名获取uid和库路径 先通过pm命令获取安装位置
8295 if global_config .Name != "" {
8396 return parseByPackage (global_config .Name )
@@ -210,6 +223,7 @@ func init() {
210223 rootCmd .PersistentFlags ().StringVarP (& global_config .Name , "name" , "n" , "" , "must set uid or package name" )
211224 rootCmd .PersistentFlags ().Uint64VarP (& global_config .Uid , "uid" , "u" , 0 , "must set uid or package name" )
212225 rootCmd .PersistentFlags ().Uint64VarP (& global_config .Pid , "pid" , "p" , 0 , "add pid to filter" )
226+ rootCmd .PersistentFlags ().StringVarP (& global_config .TidsBlacklist , "no-tids" , "" , "" , "tid black list, max 5" )
213227 rootCmd .PersistentFlags ().BoolVarP (& global_config .Debug , "debug" , "d" , false , "enable debug logging" )
214228 rootCmd .PersistentFlags ().StringVarP (& global_config .LoggerFile , "out" , "o" , "" , "-o save the packets to file" )
215229 rootCmd .PersistentFlags ().BoolVarP (& global_config .Quiet , "quiet" , "" , false , "use with --log-file, wont logging to terminal when used" )
0 commit comments