mdiag: initial commit