Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit5e24e4a

Browse files
mwiniarsickle
authored andcommitted
drm/i915/guc: Don't print out relay statistics when relay is disabled
If nobody has enabled the relay, we're not comunicating with GuC, whichmeans that the stats don't have any meaning. Let's also remove interruptcounter and tidy the debugfs formatting.v2: Correct stats accounting (Sagar)v3: Corrected one more error in stats accounting, move relay_enabled (Sagar)Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>Cc: Chris Wilson <chris@chris-wilson.co.uk>Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>Link:https://patchwork.freedesktop.org/patch/msgid/20180319095348.9716-9-michal.winiarski@intel.com
1 parentdb55799 commit5e24e4a

File tree

4 files changed

+52
-38
lines changed

4 files changed

+52
-38
lines changed

‎drivers/gpu/drm/i915/i915_debugfs.c‎

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,30 +2325,45 @@ static int i915_guc_load_status_info(struct seq_file *m, void *data)
23252325
return0;
23262326
}
23272327

2328-
staticvoidi915_guc_log_info(structseq_file*m,
2329-
structdrm_i915_private*dev_priv)
2328+
staticconstchar*
2329+
stringify_guc_log_type(enumguc_log_buffer_typetype)
23302330
{
2331-
structintel_guc*guc=&dev_priv->guc;
2332-
2333-
seq_puts(m,"GuC logging stats:\n");
2331+
switch (type) {
2332+
caseGUC_ISR_LOG_BUFFER:
2333+
return"ISR";
2334+
caseGUC_DPC_LOG_BUFFER:
2335+
return"DPC";
2336+
caseGUC_CRASH_DUMP_LOG_BUFFER:
2337+
return"CRASH";
2338+
default:
2339+
MISSING_CASE(type);
2340+
}
23342341

2335-
seq_printf(m,"\tISR: flush count %10u, overflow count %10u\n",
2336-
guc->log.flush_count[GUC_ISR_LOG_BUFFER],
2337-
guc->log.total_overflow_count[GUC_ISR_LOG_BUFFER]);
2342+
return"";
2343+
}
23382344

2339-
seq_printf(m,"\tDPC: flush count %10u, overflow count %10u\n",
2340-
guc->log.flush_count[GUC_DPC_LOG_BUFFER],
2341-
guc->log.total_overflow_count[GUC_DPC_LOG_BUFFER]);
2345+
staticvoidi915_guc_log_info(structseq_file*m,
2346+
structdrm_i915_private*dev_priv)
2347+
{
2348+
structintel_guc_log*log=&dev_priv->guc.log;
2349+
enumguc_log_buffer_typetype;
23422350

2343-
seq_printf(m,"\tCRASH: flush count %10u, overflow count %10u\n",
2344-
guc->log.flush_count[GUC_CRASH_DUMP_LOG_BUFFER],
2345-
guc->log.total_overflow_count[GUC_CRASH_DUMP_LOG_BUFFER]);
2351+
if (!intel_guc_log_relay_enabled(log)) {
2352+
seq_puts(m,"GuC log relay disabled\n");
2353+
return;
2354+
}
23462355

2347-
seq_printf(m,"\tTotal flush interrupt count: %u\n",
2348-
guc->log.flush_interrupt_count);
2356+
seq_puts(m,"GuC logging stats:\n");
23492357

23502358
seq_printf(m,"\tRelay full count: %u\n",
2351-
guc->log.relay.full_count);
2359+
log->relay.full_count);
2360+
2361+
for (type=GUC_ISR_LOG_BUFFER;type<GUC_MAX_LOG_BUFFER;type++) {
2362+
seq_printf(m,"\t%s:\tflush count %10u, overflow count %10u\n",
2363+
stringify_guc_log_type(type),
2364+
log->stats[type].flush,
2365+
log->stats[type].sampled_overflow);
2366+
}
23522367
}
23532368

23542369
staticvoidi915_guc_client_info(structseq_file*m,

‎drivers/gpu/drm/i915/intel_guc.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,9 @@ void intel_guc_to_host_event_handler(struct intel_guc *guc)
390390
spin_unlock(&guc->irq_lock);
391391

392392
if (msg& (INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER |
393-
INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED)) {
393+
INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED))
394394
queue_work(guc->log.relay.flush_wq,
395395
&guc->log.relay.flush_work);
396-
397-
guc->log.flush_interrupt_count++;
398-
}
399396
}
400397

401398
intintel_guc_sample_forcewake(structintel_guc*guc)

‎drivers/gpu/drm/i915/intel_guc_log.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,18 @@ static bool guc_check_log_buf_overflow(struct intel_guc_log *log,
195195
enumguc_log_buffer_typetype,
196196
unsignedintfull_cnt)
197197
{
198-
unsignedintprev_full_cnt=log->prev_overflow_count[type];
198+
unsignedintprev_full_cnt=log->stats[type].sampled_overflow;
199199
booloverflow= false;
200200

201201
if (full_cnt!=prev_full_cnt) {
202202
overflow= true;
203203

204-
log->prev_overflow_count[type]=full_cnt;
205-
log->total_overflow_count[type]+=full_cnt-prev_full_cnt;
204+
log->stats[type].overflow=full_cnt;
205+
log->stats[type].sampled_overflow+=full_cnt-prev_full_cnt;
206206

207207
if (full_cnt<prev_full_cnt) {
208208
/* buffer_full_cnt is a 4 bit counter */
209-
log->total_overflow_count[type]+=16;
209+
log->stats[type].sampled_overflow+=16;
210210
}
211211
DRM_ERROR_RATELIMITED("GuC log buffer overflow\n");
212212
}
@@ -241,7 +241,7 @@ static void guc_read_update_log_buffer(struct intel_guc_log *log)
241241

242242
mutex_lock(&log->relay.lock);
243243

244-
if (WARN_ON(!log->relay.buf_addr))
244+
if (WARN_ON(!intel_guc_log_relay_enabled(log)))
245245
gotoout_unlock;
246246

247247
/* Get the pointer to shared GuC log buffer */
@@ -279,7 +279,7 @@ static void guc_read_update_log_buffer(struct intel_guc_log *log)
279279
full_cnt=log_buf_state_local.buffer_full_cnt;
280280

281281
/* Bookkeeping stuff */
282-
log->flush_count[type]+=log_buf_state_local.flush_to_file;
282+
log->stats[type].flush+=log_buf_state_local.flush_to_file;
283283
new_overflow=guc_check_log_buf_overflow(log,type,full_cnt);
284284

285285
/* Update the state of shared log buffer */
@@ -341,11 +341,6 @@ static void capture_logs_work(struct work_struct *work)
341341
guc_log_capture_logs(log);
342342
}
343343

344-
staticboolguc_log_relay_enabled(structintel_guc_log*log)
345-
{
346-
returnlog->relay.buf_addr;
347-
}
348-
349344
staticintguc_log_map(structintel_guc_log*log)
350345
{
351346
structintel_guc*guc=log_to_guc(log);
@@ -553,13 +548,18 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)
553548
returnret;
554549
}
555550

551+
boolintel_guc_log_relay_enabled(conststructintel_guc_log*log)
552+
{
553+
returnlog->relay.buf_addr;
554+
}
555+
556556
intintel_guc_log_relay_open(structintel_guc_log*log)
557557
{
558558
intret;
559559

560560
mutex_lock(&log->relay.lock);
561561

562-
if (guc_log_relay_enabled(log)) {
562+
if (intel_guc_log_relay_enabled(log)) {
563563
ret=-EEXIST;
564564
gotoout_unlock;
565565
}
@@ -628,7 +628,7 @@ void intel_guc_log_relay_close(struct intel_guc_log *log)
628628
flush_work(&log->relay.flush_work);
629629

630630
mutex_lock(&log->relay.lock);
631-
GEM_BUG_ON(!guc_log_relay_enabled(log));
631+
GEM_BUG_ON(!intel_guc_log_relay_enabled(log));
632632
guc_log_unmap(log);
633633
guc_log_relay_destroy(log);
634634
mutex_unlock(&log->relay.lock);

‎drivers/gpu/drm/i915/intel_guc_log.h‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ struct intel_guc_log {
5252
u32full_count;
5353
}relay;
5454
/* logging related stats */
55-
u32flush_interrupt_count;
56-
u32prev_overflow_count[GUC_MAX_LOG_BUFFER];
57-
u32total_overflow_count[GUC_MAX_LOG_BUFFER];
58-
u32flush_count[GUC_MAX_LOG_BUFFER];
55+
struct {
56+
u32sampled_overflow;
57+
u32overflow;
58+
u32flush;
59+
}stats[GUC_MAX_LOG_BUFFER];
5960
};
6061

6162
voidintel_guc_log_init_early(structintel_guc_log*log);
@@ -64,6 +65,7 @@ void intel_guc_log_destroy(struct intel_guc_log *log);
6465

6566
intintel_guc_log_level_get(structintel_guc_log*log);
6667
intintel_guc_log_level_set(structintel_guc_log*log,u64control_val);
68+
boolintel_guc_log_relay_enabled(conststructintel_guc_log*log);
6769
intintel_guc_log_relay_open(structintel_guc_log*log);
6870
voidintel_guc_log_relay_flush(structintel_guc_log*log);
6971
voidintel_guc_log_relay_close(structintel_guc_log*log);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp