mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Merged in antmerlino/nuttx/iobinstrumentation (pull request #1001)
Iobinstrumentation * mm/iob: Introduces producer/consumer id to every iob call. This is so that the calls can be instrumented to monitor the IOB resources. * iob instrumentation - Merges producer/consumer enumeration for simpler IOB user. * fs/procfs: Starts adding support for /proc/iobinfo * fs/procfs: Finishes first pass of simple IOB user stastics and /proc/iobinfo entry Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
f5f302cff5
commit
70404ed0dc
@@ -348,7 +348,7 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type,
|
||||
* available buffers.
|
||||
*/
|
||||
|
||||
buf->frame = iob_alloc(false);
|
||||
buf->frame = iob_alloc(false, IOBUSER_WIRELESS_BLUETOOTH);
|
||||
if (!buf->frame)
|
||||
{
|
||||
wlerr("ERROR: Failed to allocate an IOB\n");
|
||||
@@ -407,7 +407,7 @@ void bt_buf_release(FAR struct bt_buf_s *buf)
|
||||
|
||||
if (buf->frame != NULL)
|
||||
{
|
||||
iob_free(buf->frame);
|
||||
iob_free(buf->frame, IOBUSER_WIRELESS_BLUETOOTH);
|
||||
buf->frame = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ drop:
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(frame);
|
||||
iob_free(frame, IOBUSER_WIRELESS_BLUETOOTH);
|
||||
|
||||
/* Increment statistics */
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ void mac802154_createdatareq(FAR struct ieee802154_privmac_s *priv,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false);
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -437,7 +437,8 @@ static void mac802154_notify_worker(FAR void *arg)
|
||||
|
||||
if (dispose)
|
||||
{
|
||||
iob_free(primitive->u.dataind.frame);
|
||||
iob_free(primitive->u.dataind.frame,
|
||||
IOBUSER_WIRELESS_MAC802154);
|
||||
ieee802154_primitive_free(primitive);
|
||||
}
|
||||
}
|
||||
@@ -768,7 +769,7 @@ static void mac802154_purge_worker(FAR void *arg)
|
||||
|
||||
/* Free the IOB, the notification, and the tx descriptor */
|
||||
|
||||
iob_free(txdesc->frame);
|
||||
iob_free(txdesc->frame, IOBUSER_WIRELESS_MAC802154);
|
||||
ieee802154_primitive_free((FAR struct ieee802154_primitive_s *)
|
||||
txdesc->conf);
|
||||
mac802154_txdesc_free(priv, txdesc);
|
||||
@@ -1009,7 +1010,7 @@ static void mac802154_txdone_worker(FAR void *arg)
|
||||
|
||||
/* Free the IOB and the tx descriptor */
|
||||
|
||||
iob_free(txdesc->frame);
|
||||
iob_free(txdesc->frame, IOBUSER_WIRELESS_MAC802154);
|
||||
mac802154_txdesc_free(priv, txdesc);
|
||||
}
|
||||
|
||||
@@ -1547,7 +1548,7 @@ static void mac802154_rxdatareq(FAR struct ieee802154_privmac_s *priv,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false);
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
|
||||
@@ -146,7 +146,7 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false);
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -159,7 +159,7 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
mac802154_unlock(priv)
|
||||
mac802154_givesem(&priv->opsem);
|
||||
return ret;
|
||||
@@ -333,7 +333,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false);
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -407,7 +407,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
ret = mac802154_lock(priv, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ int mac802154_resp_associate(MACHANDLE mac,
|
||||
ret = mac802154_txdesc_alloc(priv, &txdesc, true);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154);
|
||||
mac802154_unlock(priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ static ssize_t mac802154dev_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Free the IOB */
|
||||
|
||||
iob_free(ind->frame);
|
||||
iob_free(ind->frame, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
|
||||
/* Deallocate the data indication */
|
||||
|
||||
@@ -542,7 +542,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep,
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
|
||||
iob = iob_alloc(false);
|
||||
iob = iob_alloc(false, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
DEBUGASSERT(iob != NULL);
|
||||
|
||||
iob->io_flink = NULL;
|
||||
@@ -571,7 +571,7 @@ static ssize_t mac802154dev_write(FAR struct file *filep,
|
||||
ret = mac802154_req_data(dev->md_mac, &tx->meta, iob);
|
||||
if (ret < 0)
|
||||
{
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_CHARDEV);
|
||||
wlerr("ERROR: req_data failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1213,13 +1213,13 @@ static int macnet_req_data(FAR struct radio_driver_s *netdev,
|
||||
{
|
||||
wlerr("ERROR: mac802154_req_data failed: %d\n", ret);
|
||||
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_NETDEV);
|
||||
for (iob = framelist; iob != NULL; iob = framelist)
|
||||
{
|
||||
/* Remove the IOB from the queue and free */
|
||||
|
||||
framelist = iob->io_flink;
|
||||
iob_free(iob);
|
||||
iob_free(iob, IOBUSER_WIRELESS_MAC802154_NETDEV);
|
||||
}
|
||||
|
||||
NETDEV_TXERRORS(&priv->md_dev.r_dev);
|
||||
|
||||
Reference in New Issue
Block a user