Send the tracing configuration with the rageshake data.
This commit is contained in:
parent
f3318078f2
commit
ed64403dec
4 changed files with 18 additions and 1 deletions
|
|
@ -57,6 +57,7 @@ class TracingInitializer : Initializer<Unit> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
bugReporter.cleanLogDirectoryIfNeeded()
|
bugReporter.cleanLogDirectoryIfNeeded()
|
||||||
|
bugReporter.setCurrentTracingFilter(tracingConfiguration.filterConfiguration.filter)
|
||||||
tracingService.setupTracing(tracingConfiguration)
|
tracingService.setupTracing(tracingConfiguration)
|
||||||
// Also set env variable for rust back trace
|
// Also set env variable for rust back trace
|
||||||
Os.setenv("RUST_BACKTRACE", "1", true)
|
Os.setenv("RUST_BACKTRACE", "1", true)
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,9 @@ interface BugReporter {
|
||||||
* Provide the log directory.
|
* Provide the log directory.
|
||||||
*/
|
*/
|
||||||
fun logDirectory(): File
|
fun logDirectory(): File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current tracing filter.
|
||||||
|
*/
|
||||||
|
fun setCurrentTracingFilter(tracingFilter: String)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,11 +82,11 @@ class DefaultBugReporter @Inject constructor(
|
||||||
private const val LOG_CAT_FILENAME = "logcat.log"
|
private const val LOG_CAT_FILENAME = "logcat.log"
|
||||||
private const val LOG_DIRECTORY_NAME = "logs"
|
private const val LOG_DIRECTORY_NAME = "logs"
|
||||||
private const val BUFFER_SIZE = 1024 * 1024 * 50
|
private const val BUFFER_SIZE = 1024 * 1024 * 50
|
||||||
|
var currentTracingFilter: String? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// the pending bug report call
|
// the pending bug report call
|
||||||
private var bugReportCall: Call? = null
|
private var bugReportCall: Call? = null
|
||||||
|
|
||||||
// boolean to cancel the bug report
|
// boolean to cancel the bug report
|
||||||
private val isCancelled = false
|
private val isCancelled = false
|
||||||
private val logcatCommandDebug = arrayOf("logcat", "-d", "-v", "threadtime", "*:*")
|
private val logcatCommandDebug = arrayOf("logcat", "-d", "-v", "threadtime", "*:*")
|
||||||
|
|
@ -153,6 +153,9 @@ class DefaultBugReporter @Inject constructor(
|
||||||
.addFormDataPart("device_id", deviceId)
|
.addFormDataPart("device_id", deviceId)
|
||||||
.addFormDataPart("device", Build.MODEL.trim())
|
.addFormDataPart("device", Build.MODEL.trim())
|
||||||
.addFormDataPart("locale", Locale.getDefault().toString())
|
.addFormDataPart("locale", Locale.getDefault().toString())
|
||||||
|
currentTracingFilter?.let {
|
||||||
|
builder.addFormDataPart("tracing_filter", it)
|
||||||
|
}
|
||||||
|
|
||||||
// add the gzipped files, don't cancel the whole upload if only some file failed to upload
|
// add the gzipped files, don't cancel the whole upload if only some file failed to upload
|
||||||
var uploadedSomeLogs = false
|
var uploadedSomeLogs = false
|
||||||
|
|
@ -323,6 +326,10 @@ class DefaultBugReporter @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setCurrentTracingFilter(tracingFilter: String) {
|
||||||
|
currentTracingFilter = tracingFilter
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the files on the log directory.
|
* @return the files on the log directory.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@ class FakeBugReporter(val mode: FakeBugReporterMode = FakeBugReporterMode.Succes
|
||||||
override fun logDirectory(): File {
|
override fun logDirectory(): File {
|
||||||
return File("fake")
|
return File("fake")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setCurrentTracingFilter(tracingFilter: String) {
|
||||||
|
// No op
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class FakeBugReporterMode {
|
enum class FakeBugReporterMode {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue