Repository: JetBrains/kotlin
File: libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/performance/KotlinPerformancePlugin.kt (Kotlin)

Code before:
        if (performanceExtension.metrics.isEmpty()) {
            project.logger.warn("There is no tracked metrics. Please, provide metrics in settings of $EXTENSION_NAME plugin.")
            result = false
        }
        // Find binaries with trackable performance.
        if (performanceExtension.trackedBinaries.isEmpty()) {
            project.logger.warn("There is no tracked binaries. Please, provide binaries in settings of $EXTENSION_NAME plugin.")
            result = false
        }
        return result
    }

    private fun configureTasks(project: Project, performanceExtension: PerformanceExtension) {
        // Add time listener.
        val timeListener = TaskTimerListener(project)
        project.gradle.addListener(timeListener)
        performanceExtension.trackedBinaries.forEach { binary ->
            project.tasks.create(
                binary.target.disambiguateName(lowerCamelCaseName("perfReport", binary.name)),
                NativePerformanceReport::class.java
            ) {
                it.binary = binary
                it.settings = performanceExtension
                it.timeListener = timeListener
                it.group = TASK_GROUP
                it.description = "Report results of performance measurement for binaries produced by Kotlin/Native compiler."
                binary.linkTask.finalizedBy(it)
            }
        }
    }

    override fun apply(project: Project): Unit = with(project) {
        pluginManager.withPlugin("kotlin-multiplatform") {
            val kotlinExtension = project.multiplatformExtension
            val performanceExtension = PerformanceExtension(this)
            reportDirectory = File(project.buildDir, "perfReports")

            kotlinExtension.addExtension(EXTENSION_NAME, performanceExtension)
            afterEvaluate {
                if (checkSettings(project, performanceExtension)) {
                    configureTasks(project, performanceExtension)
                }
            }
        }
    }

    companion object {
        const val EXTENSION_NAME = "performance"
        const val TASK_GROUP = "Kotlin/Native Performance"
    }
}

Review comment (performance):
I meant a certain binary this task is created for :) Say `Report performance measurement results for binary '${binary.name}' of target '${binary.target.name}'`.

Code after:
    private fun checkSettings(project: Project, performanceExtension: PerformanceExtension): Boolean {
        var result = true
        if (performanceExtension.metrics.isEmpty()) {
            project.logger.warn("There is no tracked metrics. Please, provide metrics in settings of $EXTENSION_NAME plugin.")
            result = false
        }
        // Find binaries with trackable performance.
        if (performanceExtension.trackedBinaries.isEmpty()) {
            project.logger.warn("There is no tracked binaries. Please, provide binaries in settings of $EXTENSION_NAME plugin.")
            result = false
        }
        return result
    }

    private fun configureTasks(project: Project, performanceExtension: PerformanceExtension) {
        // Add time listener.
        val timeListener = TaskTimerListener(project)
        project.gradle.addListener(timeListener)
        performanceExtension.trackedBinaries.forEach { binary ->
            project.tasks.create(
                binary.target.disambiguateName(lowerCamelCaseName("perfReport", binary.name)),
                NativePerformanceReport::class.java
            ) {
                it.binary = binary
                it.settings = performanceExtension
                it.timeListener = timeListener
                it.group = TASK_GROUP
                it.description = "Report performance measurement results for binary '${binary.name}' of target '${binary.target.name}'."
                binary.linkTask.finalizedBy(it)
            }
        }
    }

    override fun apply(project: Project): Unit = with(project) {
        pluginManager.withPlugin("kotlin-multiplatform") {
            val kotlinExtension = project.multiplatformExtension
            val performanceExtension = PerformanceExtension(this)

            kotlinExtension.addExtension(EXTENSION_NAME, performanceExtension)
            afterEvaluate {
                if (checkSettings(project, performanceExtension)) {
                    configureTasks(project, performanceExtension)
                }
            }
        }
    }

    companion object {
        const val EXTENSION_NAME = "performance"
        const val TASK_GROUP = "Kotlin/Native Performance"
    }