Author: kevans
Date: Wed Dec  9 03:22:44 2020
New Revision: 368480
URL: https://svnweb.freebsd.org/changeset/base/368480

Log:
  libsysdecode: decode _UMTX_OP flags
  
  Assume that UMTX_OP with a double underbar following is a flag, while any
  underbar+alphanumeric combination immeiately following is an op.
  
  This was a part of D27325.
  
  Reviewed by:  kib

Modified:
  head/lib/libsysdecode/flags.c
  head/lib/libsysdecode/mktables
  head/lib/libsysdecode/sysdecode.h

Modified: head/lib/libsysdecode/flags.c
==============================================================================
--- head/lib/libsysdecode/flags.c       Wed Dec  9 03:20:51 2020        
(r368479)
+++ head/lib/libsysdecode/flags.c       Wed Dec  9 03:22:44 2020        
(r368480)
@@ -941,6 +941,20 @@ sysdecode_umtx_op(int op)
        return (lookup_value(umtxop, op));
 }
 
+bool
+sysdecode_umtx_op_flags(FILE *fp, int op, int *rem)
+{
+       uintmax_t val;
+       bool printed;
+
+       printed = false;
+       val = (unsigned)op;
+       print_mask_part(fp, umtxopflags, &val, &printed);
+       if (rem != NULL)
+               *rem = val;
+       return (printed);
+}
+
 const char *
 sysdecode_vmresult(int result)
 {

Modified: head/lib/libsysdecode/mktables
==============================================================================
--- head/lib/libsysdecode/mktables      Wed Dec  9 03:20:51 2020        
(r368479)
+++ head/lib/libsysdecode/mktables      Wed Dec  9 03:22:44 2020        
(r368480)
@@ -145,7 +145,8 @@ gen_table "sockoptudp"      "UDP_[[:alnum:]]+[[:space:
 gen_table "sockoptudplite"  "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+"      
"netinet/udplite.h"
 gen_table "socktype"        "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*"          
"sys/socket.h"
 gen_table "thrcreateflags"  "THR_[A-Z]+[[:space:]]+0x[0-9]+"               
"sys/thr.h"
-gen_table "umtxop"          "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+"      
"sys/umtx.h"
+gen_table "umtxop"          
"UMTX_OP_[[:alnum:]][[:alnum:]_]*[[:space:]]+[0-9]+"      "sys/umtx.h"
+gen_table "umtxopflags"     "UMTX_OP__[[:alnum:]_]+[[:space:]]+[0-9]+"         
       "sys/umtx.h"
 gen_table "vmprot"          
"VM_PROT_[A-Z]+[[:space:]]+\(\(vm_prot_t\)[[:space:]]+0x[0-9]+\)"  "vm/vm.h"
 gen_table "vmresult"        "KERN_[A-Z_]+[[:space:]]+[0-9]+"               
"vm/vm_param.h"
 gen_table "wait6opt"        "W[A-Z]+[[:space:]]+[0-9]+"                    
"sys/wait.h"

Modified: head/lib/libsysdecode/sysdecode.h
==============================================================================
--- head/lib/libsysdecode/sysdecode.h   Wed Dec  9 03:20:51 2020        
(r368479)
+++ head/lib/libsysdecode/sysdecode.h   Wed Dec  9 03:22:44 2020        
(r368480)
@@ -121,6 +121,7 @@ const char *sysdecode_sysarch_number(int _number);
 bool   sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem);
 bool   sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem);
 const char *sysdecode_umtx_op(int _op);
+bool   sysdecode_umtx_op_flags(FILE *_fp, int op, int *_rem);
 bool   sysdecode_umtx_rwlock_flags(FILE *_fp, u_long _flags, u_long *_rem);
 int    sysdecode_utrace(FILE *_fp, void *_buf, size_t _len);
 bool   sysdecode_vmprot(FILE *_fp, int _type, int *_rem);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to