File size: 19,453 Bytes
34292e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
#!/usr/bin/env python3
"""
Generate reports from current logs
"""

import argparse
import os
import re
import textwrap
from collections import Counter

os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

LOGS_FOLDER = "logs"
REPORTS_FOLDER = "reports"
REPORT_FILENAME = "report.log"
SINGLE_REPORT_FILENAME = f"{REPORTS_FOLDER}/report.log"
SUMMARY_FILENAME = f"{REPORTS_FOLDER}/report-summary.log"
DRC_FILENAME = "5_route_drc.rpt"
LAST_EXPECTED_LOG = ["6_report.log", "generate_abstract.log"]
METRICS_LOG = "metadata-generate.log"
METRICS_CHECK_LOG = "metadata-check.log"
CALIBRE_LOG = "calibre/save-to-drc-db.log"
REGEX_ERROR = re.compile(r"^\[error ?(\w+-\d+)?\]", re.IGNORECASE)
REGEX_WARNING = re.compile(r"^\[warning ?(\w+-\d+)?\]", re.IGNORECASE)
REGEX_SIGNAL = re.compile(r"\bsignal (\d+)|\bKilled\b")
# Metric line under "QoR regression detected for ...":
#   <metric> <current> (base <base>, limit <limit>)
REGEX_QOR_METRIC = re.compile(r"^(\S+) (\S+) \(base (\S+), limit (\S+)\)$")
REGEX_QOR_STATUS = re.compile(r"^(?:\[ERROR\] )?Dashboard QoR check: (\w+)")
# checkQorMetrics.py starts its lines with the run identity.
REGEX_RUN_PREFIX = re.compile(r"^[^\s/]+/[^\s/]+/[^\s/:]+: ")
SKIPPED_FLOW_VARIANT_KEYWORDS = ["test", "tune"]
STATUS_GREEN = "Passing"
STATUS_RED = "Failing"
TAIL_LINES = 10
RULE = "-" * 60

# Failure categories, most critical first. The summary sorts by this order.
CATEGORIES = {
    "STOP": "flow stopped",
    "ERR": "flow error",
    "DRC": "Calibre DRC",
    "QOR": "QoR regression",
}
CATEGORY_RANK = {code: rank for rank, code in enumerate(CATEGORIES)}
WARN = "WARN"
PASS = "PASS"

HELP_TEXT = """
Scans "./logs" and "./reports" folders for errors and warnings.
"""
parser = argparse.ArgumentParser(description=HELP_TEXT)

HELP_TEXT = """
Level 0: report error message ids.
Level 1: report full error messages.
Level 2: also report passing designs and warning message ids.
Level 3: also report full warning messages.
"""
parser.add_argument(
    "--verbose", "-v", required=False, default=0, action="count", help=HELP_TEXT
)

parser.add_argument(
    "--quiet",
    "-q",
    required=False,
    default=False,
    action="store_true",
    help="Do not print report to stdout.",
)

parser.add_argument(
    "--summary",
    "-s",
    required=False,
    default=False,
    action="store_true",
    help="Only write summary file.",
)

args = parser.parse_args()


def read_lines(filename):
    """Return the lines of a file, or None if it cannot be read."""
    try:
        with open(filename, "r", encoding="utf-8", errors="replace") as file:
            return file.readlines()
    except OSError:
        return None


def parse_messages(lines, source):
    """Return ([ERROR] lines, [WARNING] lines) as (source, text) pairs."""
    errors = []
    warnings = []
    for line in lines or []:
        if REGEX_ERROR.search(line):
            errors.append((source, line.strip()))
        elif REGEX_WARNING.search(line):
            warnings.append((source, line.strip()))
    return errors, warnings


def parse_qor_check(lines):
    """
    Read a metadata-check.log written by checkQorMetrics.py or the CI check.

    Returns (metrics, baseline, notes). Each metric is a tuple
    (name, current, base, limit), or a 1-tuple with the raw line when the
    format is unknown. Notes say why the QoR check did not give a verdict.
    """
    metrics = []
    baseline = None
    notes = []
    in_regressions = False
    status_note = None  # index of the note for a check without a verdict
    for line in lines or []:
        text = line.strip()
        if line.startswith("QoR regression detected for "):
            in_regressions = True
            continue
        if text.startswith("Baseline: "):
            baseline = text.split(" ", 1)[1]
            continue
        if in_regressions and line.startswith("  ") and text:
            match = REGEX_QOR_METRIC.match(text)
            metrics.append(match.groups() if match else (text,))
            continue
        in_regressions = False
        status = REGEX_QOR_STATUS.match(text)
        if status:
            status_note = None
            if status.group(1) not in ("PASS", "FAIL"):
                status_note = len(notes)
                notes.append(f"QoR check {status.group(1)}")
        elif text.startswith("Reason: ") and status_note is not None:
            notes[status_note] += f": {text.split(' ', 1)[1]}"
        elif text.startswith("[WARN] "):
            message = REGEX_RUN_PREFIX.sub("", text[len("[WARN] ") :])
            notes.append(f"QoR: {message}")
    return metrics, baseline, notes


def message_id(text, regex):
    """Return the message id (e.g. GPL-0307), or the full text if it has none."""
    match = regex.match(text)
    return match.group(1) if match and match.group(1) else text


def shorten(text, width=90):
    return textwrap.shorten(text, width=width, placeholder=" ...")


def collect(log_dir, files, report_dir):
    """Read the logs and reports of one design and classify it."""
    d = dict()
    d["output_file"] = os.path.join(report_dir, REPORT_FILENAME)
    d["log_dir"] = log_dir

    d["log_errors"] = []
    d["log_warnings"] = []
    d["last_log"] = max(
        (name for name in files if name.endswith(".log")),
        key=lambda name: os.path.getmtime(os.path.join(log_dir, name)),
        default="",
    )
    for name in sorted(files):
        errors, warnings = parse_messages(read_lines(os.path.join(log_dir, name)), name)
        d["log_errors"] += errors
        d["log_warnings"] += warnings
    d["finished"] = any(name in files for name in LAST_EXPECTED_LOG)

    missing = []

    lines = read_lines(os.path.join(report_dir, METRICS_LOG))
    if lines is None and d["finished"]:
        missing.append(METRICS_LOG)
    d["metrics_logs_errors"], d["metrics_logs_warnings"] = parse_messages(
        lines, METRICS_LOG
    )

    lines = read_lines(os.path.join(report_dir, METRICS_CHECK_LOG))
    if lines is None and d["finished"]:
        missing.append(METRICS_CHECK_LOG)
    d["metrics_errors"], _ = parse_messages(lines, METRICS_CHECK_LOG)
    d["qor_metrics"], d["qor_baseline"], qor_notes = parse_qor_check(lines)

    d["calibre_errors"], d["calibre_warnings"] = parse_messages(
        read_lines(os.path.join(log_dir, CALIBRE_LOG)), CALIBRE_LOG
    )

    d["drcs"] = Counter()
    lines = read_lines(os.path.join(report_dir, DRC_FILENAME))
    if lines is None and d["finished"]:
        missing.append(DRC_FILENAME)
    for line in lines or []:
        if "violation type:" in line:
            d["drcs"][line.split("violation type:", 1)[1].strip()] += 1

    d["tail"] = []
    d["cause"] = ""
    if not d["finished"] and d["last_log"]:
        tail = read_lines(os.path.join(log_dir, d["last_log"])) or []
        d["tail"] = [line.rstrip() for line in tail[-TAIL_LINES:]]
        for line in reversed(d["tail"]):
            match = REGEX_SIGNAL.search(line)
            if match:
                signal = match.group(1) or "9"
                d["cause"] = f"killed by signal {signal}"
                if signal == "9":
                    d["cause"] += " (out of memory?)"
                break

    if not d["finished"]:
        d["category"] = "STOP"
    elif d["log_errors"]:
        d["category"] = "ERR"
    elif d["calibre_errors"]:
        d["category"] = "DRC"
    elif d["metrics_errors"]:
        d["category"] = "QOR"
    else:
        d["category"] = None
    d["status"] = STATUS_RED if d["category"] else STATUS_GREEN

    notes = list(qor_notes)
    if missing:
        notes.append("missing " + ", ".join(missing))
    if d["status"] == STATUS_GREEN:
        notes += [f"{source}: {text}" for source, text in d["metrics_logs_errors"]]
        if d["drcs"]:
            notes.append(f"router DRC under the limit: {format_drcs(d['drcs'])}")
    d["notes"] = notes
    return d


def qor_error_lines(data):
    """
    QoR check [ERROR] lines to show. checkQorMetrics.py repeats the failing
    runs in a trailing line, so hide it unless it is the only one.
    """
    texts = [text for _, text in data["metrics_errors"]]
    shown = [t for t in texts if not t.startswith("[ERROR] Failing runs:")]
    return shown or texts


def format_drcs(drcs):
    return ", ".join(f"{name} ({count})" for name, count in drcs.items())


def qor_names(data):
    return [metric[0] for metric in data["qor_metrics"] if len(metric) == 4]


def row_code(data):
    if data["category"]:
        return data["category"]
    return WARN if data["notes"] else PASS


def sort_key(item):
    """Most critical first; more regressed metrics first within QoR."""
    name, data = item
    code = row_code(data)
    rank = CATEGORY_RANK.get(code, len(CATEGORY_RANK) + (code == PASS))
    metrics = len(data["qor_metrics"]) if code == "QOR" else 0
    return (rank, -metrics, name)


def last_error(errors):
    """Short form of the last error: the one most likely to stop the flow."""
    source, text = errors[-1]
    more = f" (+{len(errors) - 1} more)" if len(errors) > 1 else ""
    return f"{source}: {message_id(text, REGEX_ERROR)}{more}"


def row_reason(data):
    """One-line reason for the summary table."""
    code = row_code(data)
    if code == "STOP":
        if data["log_errors"]:
            return last_error(data["log_errors"])
        if not data["last_log"]:
            return "no log file found"
        return f"{data['last_log']}: {data['cause'] or 'no error message'}"
    if code == "ERR":
        return last_error(data["log_errors"])
    if code == "DRC":
        return f"Calibre: {len(data['calibre_errors'])} error(s)"
    if code == "QOR":
        names = qor_names(data)
        if not names:
            return message_id(qor_error_lines(data)[0], REGEX_ERROR)
        if len(names) == 1:
            return names[0]
        return f"{len(names)} metrics: " + ", ".join(names)
    if code == WARN:
        more = len(data["notes"]) - 1
        return data["notes"][0] + (f" (+{more} more)" if more else "")
    return "passed"


def headline(data):
    """Short description after the design name in the detail block."""
    code = data["category"]
    if code == "STOP":
        if not data["last_log"]:
            return "flow did not reach last stage, no log file found"
        text = f"stopped in {data['last_log']}"
        return f"{text}, {data['cause']}" if data["cause"] else text
    if code == "ERR":
        return f"{len(data['log_errors'])} error(s) in the logs"
    if code == "DRC":
        return f"{len(data['calibre_errors'])} Calibre error(s)"
    if code == "QOR":
        count = len(data["qor_metrics"])
        if count == 0:
            return "QoR check failed"
        return f"{count} metric{'s' if count > 1 else ''} over the limit"
    return "passed"


def message_lines(messages, regex, full):
    """
    Lines for a list of (source, text) messages.
    Full mode shows each distinct message with a repeat count.
    Otherwise one line per source with the distinct message ids.
    """
    lines = []
    if full:
        for (source, text), count in Counter(messages).items():
            repeat = f" (x{count})" if count > 1 else ""
            lines.append(f"{source}: {text}{repeat}")
        return lines
    by_source = {}
    for source, text in messages:
        by_source.setdefault(source, {})[message_id(text, regex)] = None
    for source, ids in by_source.items():
        lines.append(f"{source}: {', '.join(ids)}")
    return lines


def qor_table(metrics):
    rows = [("metric", "current", "base", "limit")]
    rows += [m for m in metrics if len(m) == 4]
    lines = []
    if len(rows) > 1:
        width = max(len(row[0]) for row in rows)
        for row in rows:
            lines.append(
                f"{row[0]:<{width}}  {row[1]:<12}  {row[2]:<12}  {row[3]}".rstrip()
            )
    lines += [m[0] for m in metrics if len(m) == 1]
    return lines


def gen_report(name, data, shared_baseline=None, with_notes=True):
    """
    Detail block for one design. Empty for a passing design without notes.
    with_notes=False leaves out the notes of a passing design, for a summary
    that already shows them under "Needs attention".
    """
    verbose = args.verbose
    if data["status"] == STATUS_GREEN and not data["notes"] and verbose < 2:
        return ""

    body = []
    if data["category"] == "STOP" and data["tail"] and not data["log_errors"]:
        body.append(f"Last {len(data['tail'])} lines of {data['last_log']}:")
        body += [f"  {line}" for line in data["tail"]]
    full = verbose >= 1
    body += message_lines(data["log_errors"], REGEX_ERROR, full)
    if data["status"] == STATUS_RED:
        body += message_lines(data["metrics_logs_errors"], REGEX_ERROR, full)
    body += message_lines(data["calibre_errors"], REGEX_ERROR, full)
    if data["metrics_errors"]:
        if data["qor_metrics"]:
            body += qor_table(data["qor_metrics"])
        else:
            body += qor_error_lines(data)
        if data["qor_baseline"] and data["qor_baseline"] != shared_baseline:
            body.append(f"Baseline: {data['qor_baseline']}")
    if data["drcs"] and data["status"] == STATUS_RED:
        body.append(f"Router DRC: {format_drcs(data['drcs'])}")
    if data["status"] == STATUS_RED:
        body += [f"Note: {note}" for note in data["notes"]]
    if verbose >= 2:
        warnings = (
            data["log_warnings"]
            + data["metrics_logs_warnings"]
            + data["calibre_warnings"]
        )
        body += message_lines(warnings, REGEX_WARNING, verbose >= 3)

    if data["status"] == STATUS_GREEN:
        if with_notes:
            lines = [f"{name}: {note}" for note in data["notes"]]
        else:
            lines = [f"{name}: passed, see NEEDS ATTENTION"] if data["notes"] else []
        lines = lines or [f"{name}: passed"]
    else:
        lines = [f"{name}: {headline(data)}"]
    lines += [f"    {line}" for line in body]
    return "\n".join(lines)


def write_report(path, content):
    """Write one design report and append it to the combined report."""
    content = content.strip()
    # A flow that stops before its first stage has no reports directory.
    os.makedirs(os.path.dirname(path), exist_ok=True)
    with open(path, "w") as file:
        file.write(content)
    if args.verbose:
        content += f"\n  Generated report file: {path}\n"
    with open(SINGLE_REPORT_FILENAME, "a") as file:
        file.write(content)
        file.write("\n")
    if not args.quiet and content != "":
        print(content)


def section(title):
    return f"{RULE}\n{title}\n{RULE}\n"


def summary_header(designs):
    failing = [d for d in designs.values() if d["status"] == STATUS_RED]
    lines = ["=" * 60]
    lines.append(
        f"SUMMARY: {len(designs)} design{'s' if len(designs) != 1 else ''}, {len(failing)} failing, "
        f"{len(designs) - len(failing)} passing"
    )
    if failing:
        counts = Counter(d["category"] for d in failing)
        lines.append(
            "  "
            + " | ".join(
                f"{label} {counts[code]}" for code, label in CATEGORIES.items()
            )
        )
    regressed = Counter(name for d in failing for name in qor_names(d))
    # A metric in one design only repeats its table row, so list shared ones.
    common = [(name, n) for name, n in regressed.most_common(3) if n > 1]
    if common:
        lines.append(
            "  Most regressed: " + ", ".join(f"{name} ({n})" for name, n in common)
        )
    baselines = {d["qor_baseline"] for d in failing if d["metrics_errors"]}
    shared_baseline = baselines.pop() if len(baselines) == 1 else None
    if shared_baseline:
        lines.append(f"  QoR baseline: {shared_baseline}")
    lines.append("=" * 60)
    return "\n".join(lines) + "\n", shared_baseline


def summary_table(rows):
    if not rows:
        return ""
    width = max(len(name) for name, _ in rows)
    lines = [
        f"{row_code(data):<4}  {name:<{width}}  {shorten(row_reason(data))}"
        for name, data in rows
    ]
    return "\n".join(lines) + "\n"


def attention_section(rows):
    """Notes of passing designs; a note shared by several designs prints once."""
    by_note = {}
    for name, data in rows:
        for note in data["notes"]:
            by_note.setdefault(note, []).append(name)
    lines = []
    for note, names in by_note.items():
        if len(names) == 1:
            lines.append(f"{names[0]}: {note}")
        else:
            lines.append(f"{note} ({len(names)} designs):")
            wrapped = textwrap.wrap(", ".join(names), width=76, break_on_hyphens=False)
            lines += [f"    {line}" for line in wrapped]
    return "\n".join(lines) + "\n"


def write_summary():
    """Write the summary: header, one row per design, then details."""
    rows = sorted(design_list.items(), key=sort_key)
    header, shared_baseline = summary_header(design_list)
    listed = [
        (name, data)
        for name, data in rows
        if row_code(data) != PASS or args.verbose >= 2
    ]

    summary = "\n" + header + "\n" + summary_table(listed)
    for code, label in CATEGORIES.items():
        group = [(n, d) for n, d in rows if d["category"] == code]
        if group:
            summary += "\n" + section(f"{label.upper()} ({len(group)})")
            summary += "\n\n".join(gen_report(n, d, shared_baseline) for n, d in group)
            summary += "\n"
    noted = [(n, d) for n, d in rows if row_code(d) == WARN]
    if noted:
        summary += "\n" + section("NEEDS ATTENTION (not failing)")
        summary += attention_section(noted)
    if args.verbose >= 2:
        passing = [(n, d) for n, d in rows if d["status"] == STATUS_GREEN]
        details = [gen_report(n, d, with_notes=False) for n, d in passing]
        if passing:
            summary += "\n" + section(f"PASSING ({len(passing)})")
            summary += "\n".join(details) + "\n"

    if not args.quiet:
        if os.path.isfile(SUMMARY_FILENAME):
            print(f"Overwriting report summary {SUMMARY_FILENAME}.")
        print(summary)
    with open(SUMMARY_FILENAME, "w") as file:
        file.write(summary)
    if not args.quiet and args.verbose:
        print("Generated report summary file:", SUMMARY_FILENAME)


design_list = dict()

if __name__ == "__main__":
    for log_dir, dirs, files in sorted(os.walk(LOGS_FOLDER, topdown=False)):
        dir_list = log_dir.split(os.sep)
        # Handles autotuner folders, which do not have `report.log` natively.
        # TODO: Can we log something for autotuner?
        if len(dir_list) != 4 or any(
            word in dir_list[-1] for word in SKIPPED_FLOW_VARIANT_KEYWORDS
        ):
            continue
        platform, design, variant = dir_list[1:]
        report_dir = log_dir.replace(LOGS_FOLDER, REPORTS_FOLDER, 1)
        design_list[f"{platform}/{design}/{variant}"] = collect(
            log_dir, files, report_dir
        )

    if not os.path.isdir(REPORTS_FOLDER):
        os.mkdir(REPORTS_FOLDER)

    if args.summary:
        write_summary()
    else:
        if os.path.isfile(SINGLE_REPORT_FILENAME):
            if not args.quiet:
                print(f"Overwriting report {SINGLE_REPORT_FILENAME}.")
            os.remove(SINGLE_REPORT_FILENAME)
        for name_, data_ in design_list.items():
            write_report(data_["output_file"], gen_report(name_, data_))