drivers/sensors: add sensor monitor log.

add flush sensor monitor log

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
This commit is contained in:
chenzihan1
2025-05-09 16:49:54 +08:00
committed by Donny(董九柱)
parent 18731b509e
commit 54cdd8c269
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -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");
} }
} }
+3
View File
@@ -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;
} }