mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +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)
|
||||
{
|
||||
sminfo(upper->name, "sensor not activated");
|
||||
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);
|
||||
if (ret >= 0)
|
||||
{
|
||||
sminfo(upper->name, "flushing start");
|
||||
user->flushing = true;
|
||||
}
|
||||
}
|
||||
@@ -1130,6 +1132,8 @@ static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
sminfo(upper->name, "flush complete with result:%d", ret);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1239,6 +1243,7 @@ static ssize_t sensor_push_event(FAR void *priv, FAR const void *data,
|
||||
user->flushing = false;
|
||||
user->event |= SENSOR_EVENT_FLUSH_COMPLETE;
|
||||
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
|
||||
{
|
||||
sminfo(dev->name, "rpmsg flushing");
|
||||
ret = sensor_rpmsg_ioctl(dev, SNIOC_FLUSH, 0, 0, true);
|
||||
sminfo(dev->name, "rpmsg flush send done, ret:%d", 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);
|
||||
if (msg->result >= 0 && msg->request == SNIOC_FLUSH)
|
||||
{
|
||||
sminfo(dev->name, "receiving flush request");
|
||||
stub->flushing = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user