Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: don't use cargo-count. #314

Merged
merged 1 commit into from
Jan 6, 2021
Merged

Conversation

efenniht
Copy link
Collaborator

@efenniht efenniht commented Jan 5, 2021

cargo-count 에는 unsafe 로 시작하는 문장을 생략하는 버그 (kbknapp/cargo-count#38) 가 있어서, 다른 도구를 새로 만들었습니다. (https://github.com/efenniht/count-unsafe)

rv6 의 경우 unsafe line 은 41.7% 입니다.

kernel-rs/src/sysfile.rs : 314/336 = 93
kernel-rs/src/sysproc.rs : 45/54 = 83
kernel-rs/src/virtio.rs : 6/76 = 7
kernel-rs/src/memlayout.rs : 0/34 = 0
kernel-rs/src/start.rs : 34/57 = 59
kernel-rs/src/riscv.rs : 154/275 = 56
kernel-rs/src/trap.rs : 122/142 = 85
kernel-rs/src/sleepablelock.rs : 13/73 = 17
kernel-rs/src/uart.rs : 11/155 = 7
kernel-rs/src/syscall.rs : 87/97 = 89
kernel-rs/src/utils.rs : 0/7 = 0
kernel-rs/src/etrace.rs : 0/117 = 0
kernel-rs/src/plic.rs : 18/22 = 81
kernel-rs/src/vm.rs : 333/508 = 65
kernel-rs/src/fcntl.rs : 0/9 = 0
kernel-rs/src/param.rs : 0/15 = 0
kernel-rs/src/kernel.rs : 47/162 = 29
kernel-rs/src/console.rs : 97/158 = 61
kernel-rs/src/lib.rs : 0/56 = 0
kernel-rs/src/kalloc.rs : 22/45 = 48
kernel-rs/src/exec.rs : 145/215 = 67
kernel-rs/src/arena.rs : 79/386 = 20
kernel-rs/src/string.rs : 28/28 = 100
kernel-rs/src/poweroff.rs : 3/10 = 30
kernel-rs/src/page.rs : 5/64 = 7
kernel-rs/src/bio.rs : 13/120 = 10
kernel-rs/src/sleeplock.rs : 13/92 = 14
kernel-rs/src/file.rs : 86/171 = 50
kernel-rs/src/virtio_disk.rs : 128/287 = 44
kernel-rs/src/proc.rs : 338/646 = 52
kernel-rs/src/spinlock.rs : 34/141 = 24
kernel-rs/src/pipe.rs : 121/163 = 74
kernel-rs/src/stat.rs : 0/12 = 0
kernel-rs/src/fs/path.rs : 0/98 = 0
kernel-rs/src/fs/inode.rs : 0/411 = 0
kernel-rs/src/fs/log.rs : 0/147 = 0
kernel-rs/src/fs/mod.rs : 0/84 = 0
kernel-rs/src/fs/superblock.rs : 0/30 = 0
Total:
2296/5503 (41.7%)

Hafnium 의 경우 27.3% 입니다.

hfo2/src/spci.rs : 3/135 = 2
hfo2/src/dlog.rs : 21/60 = 35
hfo2/src/std.rs : 81/92 = 88
hfo2/src/abi.rs : 0/108 = 0
hfo2/src/list.rs : 29/47 = 61
hfo2/src/memiter.rs : 70/123 = 56
hfo2/src/manifest.rs : 17/468 = 3
hfo2/src/boot_flow.rs : 5/63 = 7
hfo2/src/utils.rs : 0/74 = 0
hfo2/src/fdt.rs : 86/414 = 20
hfo2/src/init.rs : 104/134 = 77
hfo2/src/vm.rs : 69/402 = 17
hfo2/src/addr.rs : 5/95 = 5
hfo2/src/cpio.rs : 13/58 = 22
hfo2/src/mm.rs : 259/916 = 28
hfo2/src/slist.rs : 27/69 = 39
hfo2/src/cpu.rs : 120/405 = 29
hfo2/src/load.rs : 178/238 = 74
hfo2/src/lib.rs : 0/54 = 0
hfo2/src/hypervisor.rs : 35/536 = 6
hfo2/src/types.rs : 0/32 = 0
hfo2/src/boot_params.rs : 1/66 = 1
hfo2/src/page.rs : 23/112 = 20
hfo2/src/mpool.rs : 87/236 = 36
hfo2/src/api.rs : 165/212 = 77
hfo2/src/panic.rs : 0/16 = 0
hfo2/src/fdt_handler.rs : 246/468 = 52
hfo2/src/spinlock.rs : 31/157 = 19
hfo2/src/layout.rs : 0/15 = 0
hfo2/src/spci_architected_message.rs : 22/271 = 8
hfo2/src/arch/fake.rs : 0/24 = 0
hfo2/src/arch/mod.rs : 0/18 = 0
hfo2/src/arch/aarch64.rs : 0/87 = 0
Total:
1697/6205

@efenniht efenniht requested a review from jeehoonkang January 5, 2021 18:54
@efenniht efenniht self-assigned this Jan 5, 2021
@jeehoonkang jeehoonkang merged commit 93ed014 into kaist-cp:riscv Jan 6, 2021
@efenniht efenniht deleted the count-unsafe branch January 6, 2021 06:11
@Medowhill Medowhill mentioned this pull request Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants