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

Include panic logs for vfs in diagnose #1408

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

jeschu1
Copy link
Member

@jeschu1 jeschu1 commented Aug 2, 2019

resolves #1395

@wilbaker wilbaker added the affects: live-site Improving our ability to diagnose and fix the product label Aug 2, 2019
Copy link
Contributor

@pmj pmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, beyond that this looks reasonable to me. However it's in code that's unfamiliar to me, so I'll leave approval to someone better versed in this code.


foreach (string filePath in Directory.GetFiles(DiagnosticReportsDirectory, PanicFileExtention))
{
if (File.ReadAllText(filePath).Contains(ProjFSKext.DriverName))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will match any panics for which the ProjFS kext was loaded, not just those where it appeared in the stack trace. (There is a list of loaded kexts at the end of each panic log.) Is that the intended behaviour? Either way, it might be worth commenting on the intention of this check here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Is that the intended behaviour?

I think the intended behavior is to only include the panics where ProjFS kext appeared in the stack trace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at several panics it appears that if we're in the backtrace, we'll have the form org.vfsforgit.PrjFSKext(.

Would you advise that as the simplest way to do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this out-of-band and this does seem like the simplest solution.

GVFS/GVFS/CommandLine/DiagnoseVerb.cs Outdated Show resolved Hide resolved
GVFS/GVFS.Platform.Mac/MacPlatform.cs Outdated Show resolved Hide resolved
@kewillford
Copy link
Member

I'm wondering if we can remove the IKernelDriver.LogsFolderPath and IKernelDriver.TryFlushLogs and have one IKernelDriver.TryCopyLogs that will do the driver logs

// driver
if (this.FlushKernelDriverLogs())
{
	 string kernelLogsFolderPath = GVFSPlatform.Instance.KernelDriver.LogsFolderPath;

	// This copy sometimes fails because the OS has an exclusive lock on the etl files. The error is not actionable
	// for the user so we don't write the error message to stdout, just to our own log file.
	this.CopyAllFiles(Path.GetDirectoryName(kernelLogsFolderPath), archiveFolderPath, Path.GetFileName(kernelLogsFolderPath), copySubFolders: false, hideErrorsFromStdout: true);
}

plus the panic logs?

I'm not sure how much cleaner this would be or what you would need to pass to the method but I saw that we were already doing some GVFSPlatform.Instance specific things here and was wondering if this could fit in that same bucket or if it best to keep them separate.

@jeschu1
Copy link
Member Author

jeschu1 commented Aug 7, 2019

I'm wondering if we can remove the IKernelDriver.LogsFolderPath and IKernelDriver.TryFlushLogs and have one IKernelDriver.TryCopyLogs that will do the driver logs plus the panic logs?

@kewillford an exellent point and something I certainly though about. TryFlushLogs has a different purpose and I think putting it all in one fuctions gives that function too much responsibility. What we have here is pretty explicit (and hopefully easy to understand! :-) )

Copy link
Contributor

@pmj pmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

@jeschu1 jeschu1 merged commit 467fdc7 into microsoft:master Aug 9, 2019
@alameenshah alameenshah added this to the M159 milestone Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: live-site Improving our ability to diagnose and fix the product platform: macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mac: gvfs diagnose should capture PrjFS kernel panics
5 participants