1 // Copyright 2023 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Tests CPU profiling.
17 static void *thr(void *arg) {
25 pthread_attr_init(&attr);
26 pthread_attr_setstacksize(&attr, 256 << 10);
27 pthread_create(&th, &attr, thr, 0);
46 // Do another call into C, just to test that path too.
57 if err := trace.Start(os.Stdout); err != nil {
58 log.Fatalf("failed to start tracing: %v", err)
61 // Do a whole bunch of cgocallbacks.
63 done := make(chan bool)
64 for i := 0; i < n; i++ {
70 for i := 0; i < n; i++ {
74 // Do something to steal back any Ps from the Ms, just
78 // End of traced execution.