Skip to content

Commit 1dca5eb

Browse files
authored
Merge branch 'google:master' into master
2 parents 44b3384 + 8b9ca61 commit 1dca5eb

File tree

75 files changed

+4355
-2052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4355
-2052
lines changed

dashboard/app/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ func reportCrash(c context.Context, build *Build, req *dashapi.Crash) (*Bug, err
726726
if err := db.Get(c, bugKey, bug); err != nil {
727727
return fmt.Errorf("failed to get bug: %v", err)
728728
}
729-
bug.NumCrashes++
730729
bug.LastTime = now
731730
if save {
732731
bug.LastSavedCrash = now
@@ -741,6 +740,7 @@ func reportCrash(c context.Context, build *Build, req *dashapi.Crash) (*Bug, err
741740
if len(req.Report) != 0 {
742741
bug.HasReport = true
743742
}
743+
bug.increaseCrashStats(now)
744744
bug.HappenedOn = mergeString(bug.HappenedOn, build.Manager)
745745
// Migration of older entities (for new bugs Title is always in MergedTitles).
746746
bug.MergedTitles = mergeString(bug.MergedTitles, bug.Title)

dashboard/app/app_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,24 @@ func TestApp(t *testing.T) {
385385
c.client.pollBug()
386386

387387
// Provoke purgeOldCrashes.
388-
for i := 0; i < 30; i++ {
388+
const purgeTestIters = 30
389+
for i := 0; i < purgeTestIters; i++ {
390+
// Also test how daily counts work.
391+
if i == purgeTestIters/2 {
392+
c.advanceTime(48 * time.Hour)
393+
}
389394
crash := testCrash(build, 3)
390395
crash.Log = []byte(fmt.Sprintf("log%v", i))
391396
crash.Report = []byte(fmt.Sprintf("report%v", i))
392397
c.client.ReportCrash(crash)
393398
}
394-
c.client.pollBug()
399+
rep := c.client.pollBug()
400+
bug, _, _ := c.loadBug(rep.ID)
401+
c.expectNE(bug, nil)
402+
c.expectEQ(bug.DailyStats, []BugDailyStats{
403+
{20000101, purgeTestIters / 2},
404+
{20000103, purgeTestIters / 2},
405+
})
395406

396407
cid := &dashapi.CrashID{
397408
BuildID: "build1",

dashboard/app/entities.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const (
2121
maxTextLen = 200
2222
MaxStringLen = 1024
2323

24-
maxCrashes = 40
24+
maxCrashes = 40
25+
maxBugHistoryDays = 365 * 5
2526
)
2627

2728
type Manager struct {
@@ -101,6 +102,12 @@ type Bug struct {
101102
// bit 0 - the bug is published
102103
// bit 1 - don't want to publish it (syzkaller build/test errors)
103104
KcidbStatus int64
105+
DailyStats []BugDailyStats
106+
}
107+
108+
type BugDailyStats struct {
109+
Date int // YYYYMMDD
110+
CrashCount int
104111
}
105112

106113
type Commit struct {
@@ -533,6 +540,25 @@ func (bug *Bug) getCommitInfo(i int) Commit {
533540
return Commit{}
534541
}
535542

543+
func (bug *Bug) increaseCrashStats(now time.Time) {
544+
bug.NumCrashes++
545+
date := timeDate(now)
546+
if len(bug.DailyStats) == 0 || bug.DailyStats[len(bug.DailyStats)-1].Date < date {
547+
bug.DailyStats = append(bug.DailyStats, BugDailyStats{date, 1})
548+
} else {
549+
// It is theoretically possible that this method might get into a situation, when
550+
// the latest saved date is later than now. But we assume that this can only happen
551+
// in a small window around the start of the day and it is better to attribute a
552+
// crash to the next day than to get a mismatch between NumCrashes and the sum of
553+
// CrashCount.
554+
bug.DailyStats[len(bug.DailyStats)-1].CrashCount++
555+
}
556+
557+
if len(bug.DailyStats) > maxBugHistoryDays {
558+
bug.DailyStats = bug.DailyStats[len(bug.DailyStats)-maxBugHistoryDays:]
559+
}
560+
}
561+
536562
func markCrashReported(c context.Context, crashID int64, bugKey *db.Key, now time.Time) error {
537563
crash := new(Crash)
538564
crashKey := db.NewKey(c, "Crash", "", crashID, bugKey)

dashboard/app/jobs_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ kernel config: %[2]v
327327
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
328328
compiler: compiler2
329329
330+
Note: no patches were applied.
330331
Note: testing is done by a robot and is best-effort only.
331332
`, extBugID, kernelConfigLink))
332333
c.checkURLContents(kernelConfigLink, testBuild.KernelConfig)

dashboard/app/mail_test_result.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ git tree: {{.KernelRepoAlias}}
2727
compiler: {{.CompilerID}}
2828
{{if .UserSpaceArch}}userspace arch: {{.UserSpaceArch}}
2929
{{end}}{{if .PatchLink}}patch: {{.PatchLink}}
30-
{{end}}{{if and (not .CrashTitle) (not .Error)}}
30+
{{else}}
31+
Note: no patches were applied.{{end}}{{if and (not .CrashTitle) (not .Error)}}
3132
Note: testing is done by a robot and is best-effort only.{{end}}

dashboard/config/linux/bits/apparmor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ config:
55
- SECURITY_SELINUX: n
66
- SECURITY_SMACK: n
77
- SECURITY_APPARMOR
8+
# TODO: remove linux-next once it reaches mainline.
9+
- SECURITY_APPARMOR_INTROSPECT_POLICY: [v5.17, linux-next]
810
- SECURITY_APPARMOR_HASH
911
- SECURITY_APPARMOR_HASH_DEFAULT
1012
- SECURITY_APPARMOR_DEBUG

dashboard/config/linux/bits/arm64.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ config:
2323
- ARCH_VEXPRESS
2424
- I2C_VERSATILE
2525
- CLK_SP810
26-
- ICST
26+
- ICST: [-v5.16]
27+
- CLK_ICST: [v5.16]
2728

2829
# These are enabled by defconfig, but we don't test them (presumably).
2930
# Disable them to speed up kernel boot (slow in emulation).
@@ -47,7 +48,6 @@ config:
4748
- DRM_LIMA: n
4849
- DRM_PANFROST: n
4950
- DRM_LEGACY: n
50-
- FB_SMSCUFX: n
5151
- FB_IBM_GXT4500: n
5252
- SMS_SIANO_RC: n
5353
- V4L_PLATFORM_DRIVERS: n

dashboard/config/linux/bits/base.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ config:
9494
# Added in 919067cc845f ("net: add CONFIG_PCPU_DEV_REFCNT") and should appear in v5.13.
9595
- PCPU_DEV_REFCNT: [n, v5.13]
9696

97+
- NET_DEV_REFCNT_TRACKER: [v5.17]
98+
- NET_NS_REFCNT_TRACKER: [v5.17]
99+
97100
# This config does not add any debug checks (only debug output).
98101
- DEBUG_KOBJECT: n
99102

@@ -109,9 +112,11 @@ config:
109112
# KCOV slows down execution too much with KASAN_HW_TAGS and in qemu emulation in general.
110113
# KCOV crashes on Arm:
111114
# https://lore.kernel.org/linux-arm-kernel/20210119130010.GA2338@C02TD0UTHF1T.local/T/#m78fdfcc41ae831f91c93ad5dabe63f7ccfb482f0
112-
- KCOV: [-arm64, -arm]
113-
- KCOV_INSTRUMENT_ALL: [-arm64, -arm]
114-
- KCOV_ENABLE_COMPARISONS: [-arm64, -arm]
115+
# KCOV is not supported on s390 with our toolchain now, config depends on:
116+
# (!ARCH_WANTS_NO_INSTR [=y] || STACK_VALIDATION [=n] || GCC_VERSION [=110200]>=120000 || CLANG_VERSION [=0]>=130000)
117+
- KCOV: [-arm64, -arm, -s390]
118+
- KCOV_INSTRUMENT_ALL: [-arm64, -arm, -s390]
119+
- KCOV_ENABLE_COMPARISONS: [-arm64, -arm, -s390]
115120
- DEBUG_FS
116121

117122
# Required for KCOV but also eliminates unnecessary non-determinism.
@@ -168,6 +173,9 @@ config:
168173
# Don't test/need this (may be enabled via HID_HYPERV_MOUSE in USB/HID configs).
169174
- HYPERV: n
170175

176+
# Don't test/need this.
177+
- XEN: n
178+
171179
# These are legacy gadget drivers that we don't reach/test and some of these break boot:
172180
# https://github.com/google/syzkaller/pull/1975#issuecomment-712807462
173181
- USB_G_NCM: n

dashboard/config/linux/bits/chromeos-5.10.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
kernel:
55
repo: https://chromium.googlesource.com/chromiumos/third_party/kernel
6-
tag: c147240ea86e
6+
# HEAD of chromeos-5.10 branch.
7+
tag: f8eeaf8c39fb2e2ab00f24cbc728de960815aa69
78

89
shell:
910
- chromeos/scripts/prepareconfig chromiumos-x86_64 ${BUILDDIR}/.config

dashboard/config/linux/bits/chromeos-5.15.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
kernel:
55
repo: https://chromium.googlesource.com/chromiumos/third_party/kernel
6-
tag: 0faa8c9f9dc4
6+
# HEAD of chromeos-5.15 branch.
7+
tag: 2ee474844f9c81d30317b9ad7f26009556414504
78

89
shell:
910
- chromeos/scripts/prepareconfig chromiumos-x86_64 ${BUILDDIR}/.config

0 commit comments

Comments
 (0)