c_cpp [illumos和bsros datalink layer]用于观察dladm和libdladm行为的Dtrace片段#tags:dladm,datalink,数据链管理,

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp [illumos和bsros datalink layer]用于观察dladm和libdladm行为的Dtrace片段#tags:dladm,datalink,数据链管理,相关的知识,希望对你有一定的参考价值。

dtrace -qn 'pid$target::i_dladm_set_linkprop:return {print(arg1)}' -c 'dladm set-linkprop -p mtu=9000 vmxnet3s1'
dtrace -qn 'pid$target::dladm_datalink_id2info:return {print(arg1)}' -c 'dladm set-linkprop -p mtu=9000 vmxnet3s1'
dtrace -qn 'pid$target::i_dladm_set_single_prop:return {print(arg1)}' -c 'dladm set-linkprop -p mtu=9000 vmxnet3s1'
// Run the following in conjunction with something like: # dladm create-aggr -l ixgbe3 aggr1
dtrace -qn '::i_mac_unicast_add:entry {print((*(mac_client_impl_t *)args[0]).mci_state_flags & EBUSY)}'

dtrace -qn ':mac:i_mac_unicast_add:entry {
  this->excl = (*(mac_client_impl_t *)args[0]).mci_state_flags & 0x0002;
  this->busy = (*(mac_client_impl_t *)args[0]).mci_state_flags & EBUSY;
  this->nact = (*(mac_client_impl_t *)args[0]).mci_mip->mi_nactiveclients;
  /* 
   * print memory locations of associated  
   * mac_client_impl_s and mac_client_impl_t.
   */
  print((struct mac_client_impl_s *)args[0]);
  print(((mac_client_impl_t *)args[0])->mci_mip);
  printf("Busy=%s Exclusive=%s Count.Active=%d\n", 
          this->busy == EBUSY ? "Y" : "N", this->excl == 0x0002 ? "Y" : "N", this->nact);
}'
typedef enum {
	DLADM_STATUS_OK = 0,
	DLADM_STATUS_BADARG,
	DLADM_STATUS_FAILED,
	DLADM_STATUS_TOOSMALL,
	DLADM_STATUS_NOTSUP,
	DLADM_STATUS_NOTFOUND,
	DLADM_STATUS_BADVAL,
	DLADM_STATUS_NOMEM,
	DLADM_STATUS_EXIST,
	DLADM_STATUS_LINKINVAL,
	DLADM_STATUS_PROPRDONLY,
	DLADM_STATUS_BADVALCNT,
	DLADM_STATUS_DBNOTFOUND,
	DLADM_STATUS_DENIED,
	DLADM_STATUS_IOERR,
	DLADM_STATUS_TEMPONLY,
	DLADM_STATUS_TIMEDOUT,
	DLADM_STATUS_ISCONN,
	DLADM_STATUS_NOTCONN,
	DLADM_STATUS_REPOSITORYINVAL,
	DLADM_STATUS_MACADDRINVAL,
	DLADM_STATUS_KEYINVAL,
	DLADM_STATUS_INVALIDMACADDRLEN,
	DLADM_STATUS_INVALIDMACADDRTYPE,
	DLADM_STATUS_LINKBUSY,
	DLADM_STATUS_VIDINVAL,
	DLADM_STATUS_NONOTIF,
	DLADM_STATUS_TRYAGAIN,
	DLADM_STATUS_IPTUNTYPE,
	DLADM_STATUS_IPTUNTYPEREQD,
	DLADM_STATUS_BADIPTUNLADDR,
	DLADM_STATUS_BADIPTUNRADDR,
	DLADM_STATUS_ADDRINUSE,
	DLADM_STATUS_BADTIMEVAL,
	DLADM_STATUS_INVALIDMACADDR,
	DLADM_STATUS_INVALIDMACADDRNIC,
	DLADM_STATUS_INVALIDMACADDRINUSE,
	DLADM_STATUS_MACFACTORYSLOTINVALID,
	DLADM_STATUS_MACFACTORYSLOTUSED,
	DLADM_STATUS_MACFACTORYSLOTALLUSED,
	DLADM_STATUS_MACFACTORYNOTSUP,
	DLADM_STATUS_INVALIDMACPREFIX,
	DLADM_STATUS_INVALIDMACPREFIXLEN,
	DLADM_STATUS_BADCPUID,
	DLADM_STATUS_CPUERR,
	DLADM_STATUS_CPUNOTONLINE,
	DLADM_STATUS_BADRANGE,
	DLADM_STATUS_TOOMANYELEMENTS,
	DLADM_STATUS_DB_NOTFOUND,
	DLADM_STATUS_DB_PARSE_ERR,
	DLADM_STATUS_PROP_PARSE_ERR,
	DLADM_STATUS_ATTR_PARSE_ERR,
	DLADM_STATUS_FLOW_DB_ERR,
	DLADM_STATUS_FLOW_DB_OPEN_ERR,
	DLADM_STATUS_FLOW_DB_PARSE_ERR,
	DLADM_STATUS_FLOWPROP_DB_PARSE_ERR,
	DLADM_STATUS_FLOW_ADD_ERR,
	DLADM_STATUS_FLOW_WALK_ERR,
	DLADM_STATUS_FLOW_IDENTICAL,
	DLADM_STATUS_FLOW_INCOMPATIBLE,
	DLADM_STATUS_FLOW_EXISTS,
	DLADM_STATUS_PERSIST_FLOW_EXISTS,
	DLADM_STATUS_INVALID_IP,
	DLADM_STATUS_INVALID_PREFIXLEN,
	DLADM_STATUS_INVALID_PROTOCOL,
	DLADM_STATUS_INVALID_PORT,
	DLADM_STATUS_INVALID_DSF,
	DLADM_STATUS_INVALID_DSFMASK,
	DLADM_STATUS_INVALID_MACMARGIN,
	DLADM_STATUS_NOTDEFINED,
	DLADM_STATUS_BADPROP,
	DLADM_STATUS_MINMAXBW,
	DLADM_STATUS_NO_HWRINGS,
	DLADM_STATUS_PERMONLY,
	DLADM_STATUS_OPTMISSING,
	DLADM_STATUS_POOLCPU,
	DLADM_STATUS_INVALID_PORT_INSTANCE,
	DLADM_STATUS_PORT_IS_DOWN,
	DLADM_STATUS_PKEY_NOT_PRESENT,
	DLADM_STATUS_PARTITION_EXISTS,
	DLADM_STATUS_INVALID_PKEY,
	DLADM_STATUS_NO_IB_HW_RESOURCE,
	DLADM_STATUS_INVALID_PKEY_TBL_SIZE,
	DLADM_STATUS_PORT_NOPROTO,
	DLADM_STATUS_INVALID_MTU
} dladm_status_t;

以上是关于c_cpp [illumos和bsros datalink layer]用于观察dladm和libdladm行为的Dtrace片段#tags:dladm,datalink,数据链管理,的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp BrickstorOS和illumos系统的替代ps命令

c_cpp ESP32-后Data.ino

c_cpp data_testValgrind.cc

c_cpp read_write_data_as_raw.cpp

KVM

c_cpp 最大子序列和