mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
camera: Switch VI/ISP events to ftrace
* Switch VI frame_begin and frame_end events to produce ftrace traces instead of eventlib events. * Switch ISP task_begin and task_end events to produce ftrace traces instead of eventlib events. * Add class IDs for VI/ISP * Switch VI/ISP task_submit events to ftrace Bug 4080214 Signed-off-by: Matti Ryttylainen <mryttylainen@nvidia.com> Change-Id: I7776005bb89eaed168c65c62d8aa19c553559fdb Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2911804 Reviewed-by: Semi Malinen <smalinen@nvidia.com> Reviewed-by: Jukka Kaartinen <jkaartinen@nvidia.com> Reviewed-by: Oleg Sikorskiy <osikorskiy@nvidia.com> Reviewed-by: Ajith Kumar <ajithk@nvidia.com> Reviewed-by: Sudhir Vyas <svyas@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
1360c38cf4
commit
f19d5372b4
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2017-2022 NVIDIA Corporation. All rights reserved.
|
// Copyright (c) 2017-2023 NVIDIA Corporation. All rights reserved.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-isp.c
|
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-isp.c
|
||||||
@@ -1688,7 +1688,7 @@ int isp_capture_request(
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
nv_camera_log_submit(
|
nv_camera_log_isp_submit(
|
||||||
chan->ndev,
|
chan->ndev,
|
||||||
capture->progress_sp.id,
|
capture->progress_sp.id,
|
||||||
capture->progress_sp.threshold,
|
capture->progress_sp.threshold,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2017-2022 NVIDIA Corporation. All rights reserved.
|
// Copyright (c) 2017-2023 NVIDIA Corporation. All rights reserved.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c
|
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-vi.c
|
||||||
@@ -1392,7 +1392,7 @@ int vi_capture_request(
|
|||||||
capture_desc.header.channel_id = capture->channel_id;
|
capture_desc.header.channel_id = capture->channel_id;
|
||||||
capture_desc.capture_request_req.buffer_index = req->buffer_index;
|
capture_desc.capture_request_req.buffer_index = req->buffer_index;
|
||||||
|
|
||||||
nv_camera_log_submit(
|
nv_camera_log_vi_submit(
|
||||||
chan->ndev,
|
chan->ndev,
|
||||||
capture->progress_sp.id,
|
capture->progress_sp.id,
|
||||||
capture->progress_sp.threshold,
|
capture->progress_sp.threshold,
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
/*
|
/*
|
||||||
* nvcamera_log.c - general tracing function for vi and isp API calls
|
* nvcamera_log.c - general tracing function for vi and isp API calls
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "nvcamera_log.h"
|
#include "nvcamera_log.h"
|
||||||
|
#include "trace/events/camera_common.h"
|
||||||
#include <linux/nvhost.h>
|
#include <linux/nvhost.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <uapi/linux/nvhost_events.h>
|
#include <uapi/linux/nvhost_events.h>
|
||||||
@@ -16,63 +17,64 @@
|
|||||||
*/
|
*/
|
||||||
#define NVCAM_ENABLE_EXTRA_TRACES 0
|
#define NVCAM_ENABLE_EXTRA_TRACES 0
|
||||||
|
|
||||||
#if defined(CONFIG_EVENTLIB)
|
|
||||||
#include <linux/keventlib.h>
|
|
||||||
|
|
||||||
/*
|
void nv_camera_log_isp_submit(struct platform_device *pdev,
|
||||||
* Camera "task submission" event enabled by default
|
|
||||||
*/
|
|
||||||
void nv_camera_log_submit(struct platform_device *pdev,
|
|
||||||
u32 syncpt_id,
|
u32 syncpt_id,
|
||||||
u32 syncpt_thresh,
|
u32 syncpt_thresh,
|
||||||
u32 channel_id,
|
u32 channel_id,
|
||||||
u64 timestamp)
|
u64 timestamp)
|
||||||
{
|
{
|
||||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
struct nvhost_task_submit task_submit;
|
|
||||||
|
|
||||||
if (!pdata->eventlib_id)
|
if (pdata == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write task submit event
|
* Events are meant to be matched with their userspace
|
||||||
*/
|
|
||||||
task_submit.syncpt_id = syncpt_id;
|
|
||||||
task_submit.syncpt_thresh = syncpt_thresh;
|
|
||||||
task_submit.channel_id = channel_id;
|
|
||||||
task_submit.class_id = pdata->class;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Eventlib events are meant to be matched with their userspace
|
|
||||||
* analogues. Instead of the PID as (this) thread's ID use the
|
* analogues. Instead of the PID as (this) thread's ID use the
|
||||||
* inherited thread group ID. For the reported TID use this thread's
|
* inherited thread group ID. For the reported TID use this thread's
|
||||||
* ID (i.e. PID).
|
* ID (i.e. PID).
|
||||||
*/
|
*/
|
||||||
task_submit.tid = current->pid;
|
trace_isp_task_submit(
|
||||||
task_submit.pid = current->tgid;
|
pdata->class,
|
||||||
|
channel_id,
|
||||||
keventlib_write(pdata->eventlib_id,
|
syncpt_id,
|
||||||
&task_submit,
|
syncpt_thresh,
|
||||||
sizeof(task_submit),
|
current->pid,
|
||||||
NVHOST_TASK_SUBMIT,
|
current->tgid
|
||||||
timestamp);
|
);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(nv_camera_log_isp_submit);
|
||||||
|
|
||||||
#else
|
void nv_camera_log_vi_submit(struct platform_device *pdev,
|
||||||
|
|
||||||
void nv_camera_log_submit(struct platform_device *pdev,
|
|
||||||
u32 syncpt_id,
|
u32 syncpt_id,
|
||||||
u32 syncpt_thresh,
|
u32 syncpt_thresh,
|
||||||
u32 channel_id,
|
u32 channel_id,
|
||||||
u64 timestamp)
|
u64 timestamp)
|
||||||
{
|
{
|
||||||
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
if (pdata == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Events are meant to be matched with their userspace
|
||||||
|
* analogues. Instead of the PID as (this) thread's ID use the
|
||||||
|
* inherited thread group ID. For the reported TID use this thread's
|
||||||
|
* ID (i.e. PID).
|
||||||
|
*/
|
||||||
|
trace_vi_task_submit(
|
||||||
|
pdata->class,
|
||||||
|
channel_id,
|
||||||
|
syncpt_id,
|
||||||
|
syncpt_thresh,
|
||||||
|
current->pid,
|
||||||
|
current->tgid
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(nv_camera_log_vi_submit);
|
||||||
|
|
||||||
#endif
|
#if NVCAM_ENABLE_EXTRA_TRACES
|
||||||
EXPORT_SYMBOL_GPL(nv_camera_log_submit);
|
|
||||||
|
|
||||||
#if defined(CONFIG_EVENTLIB) && NVCAM_ENABLE_EXTRA_TRACES
|
|
||||||
#include <linux/keventlib.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Additional camera traces disabled by default
|
* Additional camera traces disabled by default
|
||||||
@@ -82,30 +84,23 @@ void nv_camera_log(struct platform_device *pdev,
|
|||||||
u32 type)
|
u32 type)
|
||||||
{
|
{
|
||||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
struct nv_camera_task_log task_log;
|
|
||||||
|
|
||||||
if (!pdata->eventlib_id)
|
if (pdata == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write task log event
|
* Events are meant to be matched with their userspace
|
||||||
*/
|
|
||||||
task_log.class_id = pdata->class;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Eventlib events are meant to be matched with their userspace
|
|
||||||
* analogues. Instead of the PID as (this) thread's ID use the
|
* analogues. Instead of the PID as (this) thread's ID use the
|
||||||
* inherited thread group ID. For the reported TID use this thread's
|
* inherited thread group ID. For the reported TID use this thread's
|
||||||
* ID (i.e. PID).
|
* ID (i.e. PID).
|
||||||
*/
|
*/
|
||||||
task_log.tid = current->pid;
|
trace_camera_task_log(
|
||||||
task_log.pid = current->tgid;
|
pdata->class,
|
||||||
|
|
||||||
keventlib_write(pdata->eventlib_id,
|
|
||||||
&task_log,
|
|
||||||
sizeof(task_log),
|
|
||||||
type,
|
type,
|
||||||
timestamp);
|
timestamp,
|
||||||
|
current->pid,
|
||||||
|
current->tgid
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2018-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NVCAMERA_LOG_H
|
#ifndef __NVCAMERA_LOG_H
|
||||||
@@ -10,7 +10,13 @@
|
|||||||
|
|
||||||
struct platform_device;
|
struct platform_device;
|
||||||
|
|
||||||
void nv_camera_log_submit(struct platform_device *pdev,
|
void nv_camera_log_isp_submit(struct platform_device *pdev,
|
||||||
|
u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh,
|
||||||
|
u32 channel_id,
|
||||||
|
u64 timestamp);
|
||||||
|
|
||||||
|
void nv_camera_log_vi_submit(struct platform_device *pdev,
|
||||||
u32 syncpt_id,
|
u32 syncpt_id,
|
||||||
u32 syncpt_thresh,
|
u32 syncpt_thresh,
|
||||||
u32 channel_id,
|
u32 channel_id,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
#include "device-group.h"
|
#include "device-group.h"
|
||||||
|
|
||||||
@@ -125,4 +125,6 @@ struct platform_device *camrtc_device_get_byname(
|
|||||||
|
|
||||||
return platform_device_get(grp->devices[index]);
|
return platform_device_get(grp->devices[index]);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(camrtc_device_get_byname);
|
||||||
|
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
|||||||
@@ -25,11 +25,7 @@
|
|||||||
#include <linux/nvhost.h>
|
#include <linux/nvhost.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
#ifdef CONFIG_EVENTLIB
|
#include "device-group.h"
|
||||||
#include <linux/keventlib.h>
|
|
||||||
#include <uapi/linux/nvhost_events.h>
|
|
||||||
#include "rtcpu/device-group.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include <trace/events/tegra_rtcpu.h>
|
#include <trace/events/tegra_rtcpu.h>
|
||||||
@@ -93,7 +89,6 @@ struct tegra_rtcpu_trace {
|
|||||||
/* debugfs */
|
/* debugfs */
|
||||||
struct dentry *debugfs_root;
|
struct dentry *debugfs_root;
|
||||||
|
|
||||||
/* eventlib */
|
|
||||||
struct platform_device *vi_platform_device;
|
struct platform_device *vi_platform_device;
|
||||||
struct platform_device *vi1_platform_device;
|
struct platform_device *vi1_platform_device;
|
||||||
struct platform_device *isp_platform_device;
|
struct platform_device *isp_platform_device;
|
||||||
@@ -716,13 +711,10 @@ static void rtcpu_trace_vinotify_event(struct camrtc_event_struct *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtcpu_trace_vi_eventlib_event(struct tegra_rtcpu_trace *tracer,
|
static void rtcpu_trace_vi_frame_event(struct tegra_rtcpu_trace *tracer,
|
||||||
struct camrtc_event_struct *event)
|
struct camrtc_event_struct *event)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_EVENTLIB
|
|
||||||
struct nvhost_device_data *pdata = NULL;
|
struct nvhost_device_data *pdata = NULL;
|
||||||
struct nvhost_task_begin task_begin;
|
|
||||||
struct nvhost_task_end task_end;
|
|
||||||
u64 ts = 0;
|
u64 ts = 0;
|
||||||
u32 vi_unit_id = event->data.data32[6];
|
u32 vi_unit_id = event->data.data32[6];
|
||||||
|
|
||||||
@@ -733,52 +725,40 @@ static void rtcpu_trace_vi_eventlib_event(struct tegra_rtcpu_trace *tracer,
|
|||||||
pdata = platform_get_drvdata(tracer->vi_platform_device);
|
pdata = platform_get_drvdata(tracer->vi_platform_device);
|
||||||
else if (vi_unit_id == 1)
|
else if (vi_unit_id == 1)
|
||||||
pdata = platform_get_drvdata(tracer->vi1_platform_device);
|
pdata = platform_get_drvdata(tracer->vi1_platform_device);
|
||||||
|
|
||||||
if (pdata == NULL)
|
if (pdata == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pdata->eventlib_id) {
|
|
||||||
pr_warn("%s kernel eventlib id %d cannot be found\n",
|
|
||||||
__func__, pdata->eventlib_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->header.id) {
|
switch (event->header.id) {
|
||||||
case camrtc_trace_vi_frame_begin:
|
case camrtc_trace_vi_frame_begin:
|
||||||
/* Write task start event */
|
|
||||||
task_begin.syncpt_id = event->data.data32[0];
|
|
||||||
task_begin.syncpt_thresh = event->data.data32[1];
|
|
||||||
task_begin.class_id = pdata->class;
|
|
||||||
task_begin.channel_id = event->data.data32[2];
|
|
||||||
|
|
||||||
ts = ((u64)event->data.data32[5] << 32) |
|
ts = ((u64)event->data.data32[5] << 32) |
|
||||||
(u64)event->data.data32[4];
|
(u64)event->data.data32[4];
|
||||||
keventlib_write(pdata->eventlib_id,
|
|
||||||
&task_begin,
|
trace_vi_frame_begin(
|
||||||
sizeof(task_begin),
|
ts,
|
||||||
NVHOST_TASK_BEGIN,
|
event->data.data32[2],
|
||||||
ts);
|
event->data.data32[0],
|
||||||
|
event->data.data32[1],
|
||||||
|
pdata->class
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case camrtc_trace_vi_frame_end:
|
case camrtc_trace_vi_frame_end:
|
||||||
/* Write task end event */
|
|
||||||
task_end.syncpt_id = event->data.data32[0];
|
|
||||||
task_end.syncpt_thresh = event->data.data32[1];
|
|
||||||
task_end.class_id = pdata->class;
|
|
||||||
task_end.channel_id = event->data.data32[2];
|
|
||||||
|
|
||||||
ts = ((u64)event->data.data32[5] << 32) |
|
ts = ((u64)event->data.data32[5] << 32) |
|
||||||
(u64)event->data.data32[4];
|
(u64)event->data.data32[4];
|
||||||
keventlib_write(pdata->eventlib_id,
|
|
||||||
&task_end,
|
trace_vi_frame_end(
|
||||||
sizeof(task_end),
|
ts,
|
||||||
NVHOST_TASK_END,
|
event->data.data32[2],
|
||||||
ts);
|
event->data.data32[0],
|
||||||
|
event->data.data32[1],
|
||||||
|
pdata->class
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_warn("%pFn event id %d cannot be found\n",
|
pr_warn("%pS invalid event id %d\n",
|
||||||
__func__, pdata->eventlib_id);
|
__func__, event->header.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtcpu_trace_vi_event(struct tegra_rtcpu_trace *tracer,
|
static void rtcpu_trace_vi_event(struct tegra_rtcpu_trace *tracer,
|
||||||
@@ -787,7 +767,7 @@ static void rtcpu_trace_vi_event(struct tegra_rtcpu_trace *tracer,
|
|||||||
switch (event->header.id) {
|
switch (event->header.id) {
|
||||||
case camrtc_trace_vi_frame_begin:
|
case camrtc_trace_vi_frame_begin:
|
||||||
case camrtc_trace_vi_frame_end:
|
case camrtc_trace_vi_frame_end:
|
||||||
rtcpu_trace_vi_eventlib_event(tracer, event);
|
rtcpu_trace_vi_frame_event(tracer, event);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
trace_rtcpu_unknown(event->header.tstamp,
|
trace_rtcpu_unknown(event->header.tstamp,
|
||||||
@@ -817,13 +797,10 @@ const unsigned int g_trace_isp_falcon_task_str_count =
|
|||||||
#define TRACE_ISP_FALCON_PROFILE_START 16U
|
#define TRACE_ISP_FALCON_PROFILE_START 16U
|
||||||
#define TRACE_ISP_FALCON_PROFILE_END 17U
|
#define TRACE_ISP_FALCON_PROFILE_END 17U
|
||||||
|
|
||||||
static void rtcpu_trace_isp_eventlib_event(struct tegra_rtcpu_trace *tracer,
|
static void rtcpu_trace_isp_task_event(struct tegra_rtcpu_trace *tracer,
|
||||||
struct camrtc_event_struct *event)
|
struct camrtc_event_struct *event)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_EVENTLIB
|
|
||||||
struct nvhost_device_data *pdata = NULL;
|
struct nvhost_device_data *pdata = NULL;
|
||||||
struct nvhost_task_begin task_begin;
|
|
||||||
struct nvhost_task_end task_end;
|
|
||||||
|
|
||||||
if (tracer->isp_platform_device == NULL)
|
if (tracer->isp_platform_device == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -832,41 +809,30 @@ static void rtcpu_trace_isp_eventlib_event(struct tegra_rtcpu_trace *tracer,
|
|||||||
if (pdata == NULL)
|
if (pdata == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pdata->eventlib_id) {
|
|
||||||
pr_warn("%s kernel eventlib id %d cannot be found\n",
|
|
||||||
__func__, pdata->eventlib_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->header.id) {
|
switch (event->header.id) {
|
||||||
case camrtc_trace_isp_task_begin:
|
case camrtc_trace_isp_task_begin:
|
||||||
/* Write task start event */
|
trace_isp_task_begin(
|
||||||
task_begin.syncpt_id = event->data.data32[0];
|
event->header.tstamp,
|
||||||
task_begin.syncpt_thresh = event->data.data32[1];
|
event->data.data32[2],
|
||||||
task_begin.class_id = pdata->class;
|
event->data.data32[0],
|
||||||
task_begin.channel_id = event->data.data32[2];
|
event->data.data32[1],
|
||||||
|
pdata->class
|
||||||
keventlib_write(pdata->eventlib_id,
|
);
|
||||||
&task_begin,
|
|
||||||
sizeof(task_begin),
|
|
||||||
NVHOST_TASK_BEGIN,
|
|
||||||
event->header.tstamp);
|
|
||||||
break;
|
break;
|
||||||
case camrtc_trace_isp_task_end:
|
case camrtc_trace_isp_task_end:
|
||||||
/* Write task end event */
|
trace_isp_task_end(
|
||||||
task_end.syncpt_id = event->data.data32[0];
|
event->header.tstamp,
|
||||||
task_end.syncpt_thresh = event->data.data32[1];
|
event->data.data32[2],
|
||||||
task_end.class_id = pdata->class;
|
event->data.data32[0],
|
||||||
task_end.channel_id = event->data.data32[2];
|
event->data.data32[1],
|
||||||
|
pdata->class
|
||||||
keventlib_write(pdata->eventlib_id,
|
);
|
||||||
&task_end,
|
break;
|
||||||
sizeof(task_end),
|
default:
|
||||||
NVHOST_TASK_END,
|
pr_warn("%pS invalid event id %d\n",
|
||||||
event->header.tstamp);
|
__func__, event->header.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtcpu_trace_isp_falcon_event(struct camrtc_event_struct *event)
|
static void rtcpu_trace_isp_falcon_event(struct camrtc_event_struct *event)
|
||||||
@@ -917,7 +883,7 @@ static void rtcpu_trace_isp_event(struct tegra_rtcpu_trace *tracer,
|
|||||||
switch (event->header.id) {
|
switch (event->header.id) {
|
||||||
case camrtc_trace_isp_task_begin:
|
case camrtc_trace_isp_task_begin:
|
||||||
case camrtc_trace_isp_task_end:
|
case camrtc_trace_isp_task_end:
|
||||||
rtcpu_trace_isp_eventlib_event(tracer, event);
|
rtcpu_trace_isp_task_event(tracer, event);
|
||||||
break;
|
break;
|
||||||
case camrtc_trace_isp_falcon_traces_event:
|
case camrtc_trace_isp_falcon_traces_event:
|
||||||
rtcpu_trace_isp_falcon_event(event);
|
rtcpu_trace_isp_falcon_event(event);
|
||||||
@@ -1441,21 +1407,21 @@ struct tegra_rtcpu_trace *tegra_rtcpu_trace_create(struct device *dev,
|
|||||||
/* Debugfs */
|
/* Debugfs */
|
||||||
rtcpu_trace_debugfs_init(tracer);
|
rtcpu_trace_debugfs_init(tracer);
|
||||||
|
|
||||||
#ifdef CONFIG_EVENTLIB
|
|
||||||
if (camera_devices != NULL) {
|
if (camera_devices != NULL) {
|
||||||
/* Eventlib */
|
|
||||||
tracer->isp_platform_device =
|
tracer->isp_platform_device =
|
||||||
camrtc_device_get_byname(camera_devices, "isp");
|
camrtc_device_get_byname(camera_devices, "isp");
|
||||||
if (IS_ERR(tracer->isp_platform_device)) {
|
if (IS_ERR(tracer->isp_platform_device)) {
|
||||||
dev_info(dev, "no camera-device \"%s\"\n", "isp");
|
dev_info(dev, "no camera-device \"%s\"\n", "isp");
|
||||||
tracer->isp_platform_device = NULL;
|
tracer->isp_platform_device = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tracer->vi_platform_device =
|
tracer->vi_platform_device =
|
||||||
camrtc_device_get_byname(camera_devices, "vi0");
|
camrtc_device_get_byname(camera_devices, "vi0");
|
||||||
if (IS_ERR(tracer->vi_platform_device)) {
|
if (IS_ERR(tracer->vi_platform_device)) {
|
||||||
dev_info(dev, "no camera-device \"%s\"\n", "vi0");
|
dev_info(dev, "no camera-device \"%s\"\n", "vi0");
|
||||||
tracer->vi_platform_device = NULL;
|
tracer->vi_platform_device = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tracer->vi1_platform_device =
|
tracer->vi1_platform_device =
|
||||||
camrtc_device_get_byname(camera_devices, "vi1");
|
camrtc_device_get_byname(camera_devices, "vi1");
|
||||||
if (IS_ERR(tracer->vi1_platform_device)) {
|
if (IS_ERR(tracer->vi1_platform_device)) {
|
||||||
@@ -1463,7 +1429,6 @@ struct tegra_rtcpu_trace *tegra_rtcpu_trace_create(struct device *dev,
|
|||||||
tracer->vi1_platform_device = NULL;
|
tracer->vi1_platform_device = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Worker */
|
/* Worker */
|
||||||
param = WORK_INTERVAL_DEFAULT;
|
param = WORK_INTERVAL_DEFAULT;
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
/* 20% overhead */
|
/* 20% overhead */
|
||||||
#define ISP_OVERHEAD 20
|
#define ISP_OVERHEAD 20
|
||||||
|
|
||||||
|
#define ISP_CLASS_ID 0x32
|
||||||
|
|
||||||
struct host_isp5 {
|
struct host_isp5 {
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct platform_device *isp_thi;
|
struct platform_device *isp_thi;
|
||||||
@@ -307,6 +309,7 @@ struct nvhost_device_data t19_isp5_info = {
|
|||||||
.post_virt_init = isp5_priv_late_probe,
|
.post_virt_init = isp5_priv_late_probe,
|
||||||
.autosuspend_delay = 500,
|
.autosuspend_delay = 500,
|
||||||
.can_powergate = true,
|
.can_powergate = true,
|
||||||
|
.class = ISP_CLASS_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id tegra_isp5_of_match[] = {
|
static const struct of_device_id tegra_isp5_of_match[] = {
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
/* + 5% SW overhead */
|
/* + 5% SW overhead */
|
||||||
#define VI_OVERHEAD 20
|
#define VI_OVERHEAD 20
|
||||||
|
|
||||||
|
#define VI_CLASS_ID 0x30
|
||||||
|
|
||||||
struct host_vi5 {
|
struct host_vi5 {
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct platform_device *vi_thi;
|
struct platform_device *vi_thi;
|
||||||
@@ -316,6 +318,7 @@ static struct nvhost_device_data t23x_vi0_info = {
|
|||||||
.aggregate_constraints = nvhost_vi5_aggregate_constraints,
|
.aggregate_constraints = nvhost_vi5_aggregate_constraints,
|
||||||
.pre_virt_init = vi5_priv_early_probe,
|
.pre_virt_init = vi5_priv_early_probe,
|
||||||
.post_virt_init = vi5_priv_late_probe,
|
.post_virt_init = vi5_priv_late_probe,
|
||||||
|
.class = VI_CLASS_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct nvhost_device_data t23x_vi1_info = {
|
static struct nvhost_device_data t23x_vi1_info = {
|
||||||
@@ -328,6 +331,7 @@ static struct nvhost_device_data t23x_vi1_info = {
|
|||||||
.aggregate_constraints = nvhost_vi5_aggregate_constraints,
|
.aggregate_constraints = nvhost_vi5_aggregate_constraints,
|
||||||
.pre_virt_init = vi5_priv_early_probe,
|
.pre_virt_init = vi5_priv_early_probe,
|
||||||
.post_virt_init = vi5_priv_late_probe,
|
.post_virt_init = vi5_priv_late_probe,
|
||||||
|
.class = VI_CLASS_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id tegra_vi5_of_match[] = {
|
static const struct of_device_id tegra_vi5_of_match[] = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2022, NVIDIA CORPORATION, All rights reserved.
|
* Copyright (c) 2017-2023, NVIDIA CORPORATION, All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
#undef TRACE_SYSTEM
|
||||||
@@ -127,6 +127,94 @@ DEFINE_EVENT(frame, tegra_channel_capture_done,
|
|||||||
TP_PROTO(const char *str, struct timespec64 *ts),
|
TP_PROTO(const char *str, struct timespec64 *ts),
|
||||||
TP_ARGS(str, ts)
|
TP_ARGS(str, ts)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(vi_task_submit,
|
||||||
|
TP_PROTO(u32 class_id, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 pid, u32 tid),
|
||||||
|
TP_ARGS(class_id, channel_id, syncpt_id, syncpt_thresh, pid, tid),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u32, class_id)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, pid)
|
||||||
|
__field(u32, tid)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->pid = pid;
|
||||||
|
__entry->tid = tid;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"class_id:%u ch:%u syncpt_id:%u syncpt_thresh:%u pid:%u tid:%u",
|
||||||
|
__entry->class_id,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->pid,
|
||||||
|
__entry->tid)
|
||||||
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(isp_task_submit,
|
||||||
|
TP_PROTO(u32 class_id, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 pid, u32 tid),
|
||||||
|
TP_ARGS(class_id, channel_id, syncpt_id, syncpt_thresh, pid, tid),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u32, class_id)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, pid)
|
||||||
|
__field(u32, tid)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->pid = pid;
|
||||||
|
__entry->tid = tid;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"class_id:%u ch:%u syncpt_id:%u syncpt_thresh:%u pid:%u tid:%u",
|
||||||
|
__entry->class_id,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->pid,
|
||||||
|
__entry->tid)
|
||||||
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(camera_task_log,
|
||||||
|
TP_PROTO(u32 class_id, u32 type,
|
||||||
|
u64 timestamp, u32 pid, u32 tid),
|
||||||
|
TP_ARGS(class_id, type, timestamp, pid, tid),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u32, class_id)
|
||||||
|
__field(u32, type)
|
||||||
|
__field(u64, timestamp)
|
||||||
|
__field(u32, pid)
|
||||||
|
__field(u32, tid)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
__entry->type = type;
|
||||||
|
__entry->timestamp = timestamp;
|
||||||
|
__entry->pid = pid;
|
||||||
|
__entry->tid = tid;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"class_id:%u type:%u ts:%llu pid:%u tid:%u",
|
||||||
|
__entry->class_id,
|
||||||
|
__entry->type,
|
||||||
|
__entry->timestamp,
|
||||||
|
__entry->pid,
|
||||||
|
__entry->tid)
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This part must be outside protection */
|
/* This part must be outside protection */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef TRACE_SYSTEM
|
#undef TRACE_SYSTEM
|
||||||
@@ -326,6 +326,64 @@ TRACE_EVENT(rtcpu_vinotify_error,
|
|||||||
__entry->vi_ts, __entry->data)
|
__entry->vi_ts, __entry->data)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* VI events
|
||||||
|
*/
|
||||||
|
|
||||||
|
TRACE_EVENT(vi_frame_begin,
|
||||||
|
TP_PROTO(u64 tstamp, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 class_id),
|
||||||
|
TP_ARGS(tstamp, channel_id, syncpt_id, syncpt_thresh, class_id),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u64, tstamp)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, class_id)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->tstamp = tstamp;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"tstamp:%llu cch:%d syncpt_id:%u syncpt_thresh:%u class_id:%u",
|
||||||
|
__entry->tstamp,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->class_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(vi_frame_end,
|
||||||
|
TP_PROTO(u64 tstamp, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 class_id),
|
||||||
|
TP_ARGS(tstamp, channel_id, syncpt_id, syncpt_thresh, class_id),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u64, tstamp)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, class_id)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->tstamp = tstamp;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"tstamp:%llu cch:%d syncpt_id:%u syncpt_thresh:%u class_id:%u",
|
||||||
|
__entry->tstamp,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->class_id)
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NVCSI events
|
* NVCSI events
|
||||||
*/
|
*/
|
||||||
@@ -504,6 +562,60 @@ TRACE_EVENT(rtcpu_isp_falcon_tile_end,
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(isp_task_begin,
|
||||||
|
TP_PROTO(u64 tstamp, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 class_id),
|
||||||
|
TP_ARGS(tstamp, channel_id, syncpt_id, syncpt_thresh, class_id),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u64, tstamp)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, class_id)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->tstamp = tstamp;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"tstamp:%llu cch:%d syncpt_id:%u syncpt_thresh:%u class_id:%u",
|
||||||
|
__entry->tstamp,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->class_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(isp_task_end,
|
||||||
|
TP_PROTO(u64 tstamp, u32 channel_id, u32 syncpt_id,
|
||||||
|
u32 syncpt_thresh, u32 class_id),
|
||||||
|
TP_ARGS(tstamp, channel_id, syncpt_id, syncpt_thresh, class_id),
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u64, tstamp)
|
||||||
|
__field(u32, channel_id)
|
||||||
|
__field(u32, syncpt_id)
|
||||||
|
__field(u32, syncpt_thresh)
|
||||||
|
__field(u32, class_id)
|
||||||
|
),
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->tstamp = tstamp;
|
||||||
|
__entry->channel_id = channel_id;
|
||||||
|
__entry->syncpt_id = syncpt_id;
|
||||||
|
__entry->syncpt_thresh = syncpt_thresh;
|
||||||
|
__entry->class_id = class_id;
|
||||||
|
),
|
||||||
|
TP_printk(
|
||||||
|
"tstamp:%llu cch:%d syncpt_id:%u syncpt_thresh:%u class_id:%u",
|
||||||
|
__entry->tstamp,
|
||||||
|
__entry->channel_id,
|
||||||
|
__entry->syncpt_id,
|
||||||
|
__entry->syncpt_thresh,
|
||||||
|
__entry->class_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _TRACE_TEGRA_RTCPU_H */
|
#endif /* _TRACE_TEGRA_RTCPU_H */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user