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

OS logging integrated with trace for iOS #1140

Merged
merged 37 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bd01722
Import ui:uikit sample
ASalavei Feb 21, 2024
9e31136
Add logger stubs
elijah-semyonov Feb 21, 2024
5d7ba23
Merge remote-tracking branch 'origin/andrei.salavei/import-ui-uikit' …
elijah-semyonov Feb 21, 2024
41dbd87
Add stubs for Trace.
elijah-semyonov Feb 21, 2024
a158f20
Integrate CMPOSLogger with runtime.
elijah-semyonov Feb 21, 2024
8f33b47
Add category name to logger
elijah-semyonov Feb 21, 2024
0e3165a
Add to Trace to ui.
elijah-semyonov Feb 21, 2024
0a6a45e
Make trace impl private
elijah-semyonov Feb 21, 2024
a2b8769
Change annotation
elijah-semyonov Feb 21, 2024
e72cb33
Add traces
elijah-semyonov Feb 21, 2024
8171bb0
Add traces
elijah-semyonov Feb 21, 2024
d30099d
Modify trace format
elijah-semyonov Feb 26, 2024
0571e97
Fix bug
elijah-semyonov Feb 26, 2024
efdc56f
Add todo
elijah-semyonov Feb 26, 2024
42cf270
Add trace to skikoMain
elijah-semyonov Feb 26, 2024
0fc7c34
Move to ui-utils existing func
elijah-semyonov Feb 26, 2024
bebcfc4
Remove test class
elijah-semyonov Feb 26, 2024
8af1ac5
Remove Trace.jb.kt
elijah-semyonov Feb 26, 2024
0a8999a
Remove unneeded files, import trace from other package
elijah-semyonov Feb 26, 2024
9695ea1
Add dependency on objc module to ui-utils
elijah-semyonov Feb 26, 2024
02f7be7
Add proper annotations
elijah-semyonov Feb 26, 2024
ba137e1
Fix compilation error
elijah-semyonov Feb 26, 2024
9a75279
Add trace for wait signal
elijah-semyonov Feb 26, 2024
96ea8ee
Add extra traces
elijah-semyonov Feb 26, 2024
806d73e
Fix bin compat issue
elijah-semyonov Feb 26, 2024
5fa15f6
Add trace
elijah-semyonov Feb 27, 2024
d9df692
Move trace
elijah-semyonov Feb 27, 2024
ee4adeb
Unify linux source sets in `runtime`
elijah-semyonov Feb 27, 2024
1cbaaa8
Unify web targets
elijah-semyonov Feb 27, 2024
b2951f5
Remove files
elijah-semyonov Feb 27, 2024
7f279e9
Add space
elijah-semyonov Feb 27, 2024
93cd6e7
Update license header
elijah-semyonov Feb 27, 2024
5d703c9
Add tags
elijah-semyonov Feb 27, 2024
5f26c26
Remove redundant _name variable
elijah-semyonov Feb 28, 2024
af98cef
Update compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/B…
elijah-semyonov Feb 28, 2024
c5735e4
Minor refactor
elijah-semyonov Feb 28, 2024
b345cba
Remove dependency from runtime
elijah-semyonov Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions compose/runtime/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,19 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
desktopMain.dependsOn(jbMain)
jsNativeMain.dependsOn(jbMain)

linuxArm64Main.dependsOn(nativeMain)
linuxArm64Test.dependsOn(nativeTest)
linuxX64Main.dependsOn(nativeMain)
linuxX64Test.dependsOn(nativeTest)
linuxMain {
dependsOn(nativeMain)
}

linuxTest {
dependsOn(nativeTest)
}

linuxArm64Main.dependsOn(linuxMain)
linuxArm64Test.dependsOn(linuxTest)
linuxX64Main.dependsOn(linuxMain)
linuxX64Test.dependsOn(linuxTest)

mingwX64Main.dependsOn(nativeMain)
mingwX64Test.dependsOn(nativeTest)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ internal actual object Trace {
*/
actual fun endSection(token: Any?) {
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
//
// CMPOSLogger.h
// CMPUIKitUtils
//
// Created by Ilia.Semenov on 21/02/2024.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <Foundation/Foundation.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
//
// CMPOSLogger.m
// CMPUIKitUtils
//
// Created by Ilia.Semenov on 21/02/2024.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "CMPOSLogger.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
//
// CMPOSLoggerInterval.h
// CMPUIKitUtils
//
// Created by Ilia.Semenov on 21/02/2024.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <Foundation/Foundation.h>
#import <os/log.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
//
// CMPOSLoggerInterval.m
// CMPUIKitUtils
//
// Created by Ilia.Semenov on 21/02/2024.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "CMPOSLoggerInterval.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "CMPUIKitUtils.h"
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
//
// CMPUIKitUtilsTestAppApp.swift
// CMPUIKitUtilsTestApp
//
// Created by Andrei.Salavei on 30.11.23.
//
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import SwiftUI

Expand Down
8 changes: 6 additions & 2 deletions compose/ui/ui-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {

jbMain.dependsOn(commonMain)
nativeMain.dependsOn(jbMain)
jsMain.dependsOn(jbMain)
desktopMain.dependsOn(jbMain)

wasmJsMain {
Expand All @@ -85,7 +84,12 @@ if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
}
}

wasmJsMain.dependsOn(jbMain)
webMain {
dependsOn(jbMain)
}

jsMain.dependsOn(webMain)
wasmJsMain.dependsOn(webMain)

commonTest.dependencies {
implementation(kotlin("test-junit"))
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

The same - you should combine js and wasmJs into one file/sourceset - webMain

Copy link
Author

@elijah-semyonov elijah-semyonov Feb 27, 2024

Choose a reason for hiding this comment

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

Done

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.toIntRect
import androidx.compose.ui.unit.toRect
import androidx.compose.ui.util.fastAll
import androidx.compose.ui.util.trace
import kotlin.coroutines.CoroutineContext
import kotlin.math.max
import kotlin.math.min
Expand Down Expand Up @@ -192,7 +193,7 @@ internal class RootNodeOwner(
measureAndLayoutDelegate.dispatchOnPositionedCallbacks(forceDispatch = true)
}

fun draw(canvas: Canvas) {
fun draw(canvas: Canvas) = trace("RootNodeOwner:draw") {
owner.root.draw(canvas)
clearInvalidObservations()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal abstract class BaseComposeScene(
private set

private var isInvalidationDisabled = false
private inline fun <T> postponeInvalidation(crossinline block: () -> T): T {
private inline fun <T> postponeInvalidation(crossinline block: () -> T): T = trace("BaseComposeScene:postponeInvalidation") {
Copy link
Member

Choose a reason for hiding this comment

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

It's called from multiple places. Let's add label for trace in parameters of postponeInvalidation?

Copy link
Author

Choose a reason for hiding this comment

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

Done

check(!isClosed) { "ComposeScene is closed" }
isInvalidationDisabled = true
return try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.util.trace
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.Dispatchers

Expand Down Expand Up @@ -172,7 +171,7 @@ private class SingleLayerComposeSceneImpl(
mainOwner.measureAndLayout()
}

override fun draw(canvas: Canvas) = trace("SingleLayerComposeSceneImpl:draw") {
override fun draw(canvas: Canvas) {
mainOwner.draw(canvas)
}

Expand Down
Loading