mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
drivers/sensors: add sensor monitor log.
add flush sensor monitor log Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
This commit is contained in:
@@ -1094,6 +1094,7 @@ static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
if (upper->state.nsubscribers == 0)
|
if (upper->state.nsubscribers == 0)
|
||||||
{
|
{
|
||||||
|
sminfo(upper->name, "sensor not activated");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1108,6 +1109,7 @@ static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
ret = lower->ops->flush(lower, filep);
|
ret = lower->ops->flush(lower, filep);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
|
sminfo(upper->name, "flushing start");
|
||||||
user->flushing = true;
|
user->flushing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1130,6 +1132,8 @@ static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
{
|
{
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sminfo(upper->name, "flush complete with result:%d", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1239,6 +1243,7 @@ static ssize_t sensor_push_event(FAR void *priv, FAR const void *data,
|
|||||||
user->flushing = false;
|
user->flushing = false;
|
||||||
user->event |= SENSOR_EVENT_FLUSH_COMPLETE;
|
user->event |= SENSOR_EVENT_FLUSH_COMPLETE;
|
||||||
sensor_pollnotify_one(user, POLLPRI, user->role);
|
sensor_pollnotify_one(user, POLLPRI, user->role);
|
||||||
|
sminfo(upper->name, "flush complete, poll notify");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -806,7 +806,9 @@ static int sensor_rpmsg_flush(FAR struct sensor_lowerhalf_s *lower,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
sminfo(dev->name, "rpmsg flushing");
|
||||||
ret = sensor_rpmsg_ioctl(dev, SNIOC_FLUSH, 0, 0, true);
|
ret = sensor_rpmsg_ioctl(dev, SNIOC_FLUSH, 0, 0, true);
|
||||||
|
sminfo(dev->name, "rpmsg flush send done, ret:%d", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1366,6 +1368,7 @@ static int sensor_rpmsg_ioctl_handler(FAR struct rpmsg_endpoint *ept,
|
|||||||
msg->result = file_ioctl(&stub->file, msg->request, arg);
|
msg->result = file_ioctl(&stub->file, msg->request, arg);
|
||||||
if (msg->result >= 0 && msg->request == SNIOC_FLUSH)
|
if (msg->result >= 0 && msg->request == SNIOC_FLUSH)
|
||||||
{
|
{
|
||||||
|
sminfo(dev->name, "receiving flush request");
|
||||||
stub->flushing = true;
|
stub->flushing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user