blob: a23d20266337f9b627ed756d179502e4a712dfbc [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
jeffhaoe343b762011-12-05 16:36:44 -080016
17#include "trace.h"
18
jeffhaoa9ef3fd2011-12-13 18:33:43 -080019#include <sys/uio.h>
20
Elliott Hughes76160052012-12-12 16:31:20 -080021#include "base/unix_file/fd_file.h"
jeffhaoe343b762011-12-05 16:36:44 -080022#include "class_linker.h"
jeffhaoa9ef3fd2011-12-13 18:33:43 -080023#include "debugger.h"
jeffhao725a9572012-11-13 18:20:12 -080024#include "instrumentation.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080025#include "mirror/abstract_method-inl.h"
26#include "mirror/dex_cache.h"
27#include "mirror/object_array-inl.h"
Ian Rogers776ac1f2012-04-13 23:36:36 -070028#if !defined(ART_USE_LLVM_COMPILER)
Ian Rogers57b86d42012-03-27 16:05:41 -070029#include "oat/runtime/oat_support_entrypoints.h"
Ian Rogers776ac1f2012-04-13 23:36:36 -070030#endif
jeffhaoa9ef3fd2011-12-13 18:33:43 -080031#include "object_utils.h"
32#include "os.h"
Ian Rogers00f7d0e2012-07-19 15:28:27 -070033#include "scoped_thread_state_change.h"
jeffhaoe343b762011-12-05 16:36:44 -080034#include "thread.h"
Ian Rogers57b86d42012-03-27 16:05:41 -070035#include "thread_list.h"
jeffhao2692b572011-12-16 15:42:28 -080036
37namespace art {
38
Elliott Hughese119a362012-05-22 17:37:06 -070039// File format:
40// header
41// record 0
42// record 1
43// ...
44//
45// Header format:
46// u4 magic ('SLOW')
47// u2 version
48// u2 offset to data
49// u8 start date/time in usec
50// u2 record size in bytes (version >= 2 only)
51// ... padding to 32 bytes
52//
53// Record format v1:
54// u1 thread ID
55// u4 method ID | method action
56// u4 time delta since start, in usec
57//
58// Record format v2:
59// u2 thread ID
60// u4 method ID | method action
61// u4 time delta since start, in usec
62//
63// Record format v3:
64// u2 thread ID
65// u4 method ID | method action
66// u4 time delta since start, in usec
67// u4 wall time since start, in usec (when clock == "dual" only)
68//
69// 32 bits of microseconds is 70 minutes.
70//
71// All values are stored in little-endian order.
72
jeffhaoa9ef3fd2011-12-13 18:33:43 -080073static const uint32_t kTraceMethodActionMask = 0x03; // two bits
74static const char kTraceTokenChar = '*';
75static const uint16_t kTraceHeaderLength = 32;
76static const uint32_t kTraceMagicValue = 0x574f4c53;
77static const uint16_t kTraceVersionSingleClock = 2;
78static const uint16_t kTraceVersionDualClock = 3;
79static const uint16_t kTraceRecordSizeSingleClock = 10; // using v2
80static const uint16_t kTraceRecordSizeDualClock = 14; // using v3 with two timestamps
81
Elliott Hughese119a362012-05-22 17:37:06 -070082static ProfilerClockSource gDefaultTraceClockSource = kProfilerClockSourceDual;
83
jeffhaoa9ef3fd2011-12-13 18:33:43 -080084static inline uint32_t TraceMethodId(uint32_t methodValue) {
85 return (methodValue & ~kTraceMethodActionMask);
86}
Elliott Hughese119a362012-05-22 17:37:06 -070087
jeffhaoa9ef3fd2011-12-13 18:33:43 -080088static inline uint32_t TraceMethodCombine(uint32_t method, uint8_t traceEvent) {
89 return (method | traceEvent);
90}
91
Elliott Hughese119a362012-05-22 17:37:06 -070092void Trace::SetDefaultClockSource(ProfilerClockSource clock_source) {
93 gDefaultTraceClockSource = clock_source;
jeffhaoa9ef3fd2011-12-13 18:33:43 -080094}
95
Elliott Hughese119a362012-05-22 17:37:06 -070096bool Trace::UseThreadCpuClock() {
97#if defined(HAVE_POSIX_CLOCKS)
98 return clock_source_ != kProfilerClockSourceWall;
99#else
100 return false;
101#endif
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800102}
103
Elliott Hughese119a362012-05-22 17:37:06 -0700104bool Trace::UseWallClock() {
105#if defined(HAVE_POSIX_CLOCKS)
106 return clock_source_ != kProfilerClockSourceThreadCpu;
107#else
108 return true;
109#endif
110}
111
112static void MeasureClockOverhead(Trace* trace) {
113 if (trace->UseThreadCpuClock()) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800114 ThreadCpuMicroTime();
115 }
Elliott Hughese119a362012-05-22 17:37:06 -0700116 if (trace->UseWallClock()) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800117 MicroTime();
118 }
119}
120
Elliott Hughese119a362012-05-22 17:37:06 -0700121static uint32_t GetClockOverhead(Trace* trace) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800122 uint64_t start = ThreadCpuMicroTime();
123
124 for (int i = 4000; i > 0; i--) {
Elliott Hughese119a362012-05-22 17:37:06 -0700125 MeasureClockOverhead(trace);
126 MeasureClockOverhead(trace);
127 MeasureClockOverhead(trace);
128 MeasureClockOverhead(trace);
129 MeasureClockOverhead(trace);
130 MeasureClockOverhead(trace);
131 MeasureClockOverhead(trace);
132 MeasureClockOverhead(trace);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800133 }
134
135 uint64_t elapsed = ThreadCpuMicroTime() - start;
136 return uint32_t (elapsed / 32);
137}
138
Elliott Hughesffb465f2012-03-01 18:46:05 -0800139// TODO: put this somewhere with the big-endian equivalent used by JDWP.
140static void Append2LE(uint8_t* buf, uint16_t val) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800141 *buf++ = (uint8_t) val;
142 *buf++ = (uint8_t) (val >> 8);
143}
144
Elliott Hughesffb465f2012-03-01 18:46:05 -0800145// TODO: put this somewhere with the big-endian equivalent used by JDWP.
146static void Append4LE(uint8_t* buf, uint32_t val) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800147 *buf++ = (uint8_t) val;
148 *buf++ = (uint8_t) (val >> 8);
149 *buf++ = (uint8_t) (val >> 16);
150 *buf++ = (uint8_t) (val >> 24);
151}
152
Elliott Hughesffb465f2012-03-01 18:46:05 -0800153// TODO: put this somewhere with the big-endian equivalent used by JDWP.
154static void Append8LE(uint8_t* buf, uint64_t val) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800155 *buf++ = (uint8_t) val;
156 *buf++ = (uint8_t) (val >> 8);
157 *buf++ = (uint8_t) (val >> 16);
158 *buf++ = (uint8_t) (val >> 24);
159 *buf++ = (uint8_t) (val >> 32);
160 *buf++ = (uint8_t) (val >> 40);
161 *buf++ = (uint8_t) (val >> 48);
162 *buf++ = (uint8_t) (val >> 56);
163}
164
Elliott Hughese119a362012-05-22 17:37:06 -0700165Trace::Trace(File* trace_file, int buffer_size, int flags)
166 : trace_file_(trace_file), buf_(new uint8_t[buffer_size]()), flags_(flags),
167 clock_source_(gDefaultTraceClockSource), overflow_(false),
168 buffer_size_(buffer_size), start_time_(0), trace_version_(0), record_size_(0), cur_offset_(0) {
169}
170
jeffhaoe343b762011-12-05 16:36:44 -0800171void Trace::Start(const char* trace_filename, int trace_fd, int buffer_size, int flags, bool direct_to_ddms) {
jeffhao2692b572011-12-16 15:42:28 -0800172 if (Runtime::Current()->IsMethodTracingActive()) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800173 LOG(INFO) << "Trace already in progress, ignoring this request";
jeffhaoe343b762011-12-05 16:36:44 -0800174 return;
175 }
176
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700177 Runtime::Current()->GetThreadList()->SuspendAll();
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800178
jeffhao2692b572011-12-16 15:42:28 -0800179 // Open trace file if not going directly to ddms.
180 File* trace_file = NULL;
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800181 if (!direct_to_ddms) {
182 if (trace_fd < 0) {
jeffhao2692b572011-12-16 15:42:28 -0800183 trace_file = OS::OpenFile(trace_filename, true);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800184 } else {
Elliott Hughes76160052012-12-12 16:31:20 -0800185 trace_file = new File(trace_fd, "tracefile");
186 trace_file->DisableAutoClose();
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800187 }
jeffhao2692b572011-12-16 15:42:28 -0800188 if (trace_file == NULL) {
jeffhaob5e81852012-03-12 11:15:45 -0700189 PLOG(ERROR) << "Unable to open trace file '" << trace_filename << "'";
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800190 Thread::Current()->ThrowNewException("Ljava/lang/RuntimeException;",
191 StringPrintf("Unable to open trace file '%s'", trace_filename).c_str());
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700192 Runtime::Current()->GetThreadList()->ResumeAll();
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800193 return;
194 }
195 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800196
jeffhao2692b572011-12-16 15:42:28 -0800197 // Create Trace object.
jeffhao0791adc2012-04-04 11:14:32 -0700198 Trace* tracer(new Trace(trace_file, buffer_size, flags));
199
200 // Enable count of allocs if specified in the flags.
201 if ((flags && kTraceCountAllocs) != 0) {
202 Runtime::Current()->SetStatsEnabled(true);
203 }
204
jeffhao2692b572011-12-16 15:42:28 -0800205 Runtime::Current()->EnableMethodTracing(tracer);
206 tracer->BeginTracing();
207
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700208 Runtime::Current()->GetThreadList()->ResumeAll();
jeffhao2692b572011-12-16 15:42:28 -0800209}
210
211void Trace::Stop() {
212 if (!Runtime::Current()->IsMethodTracingActive()) {
213 LOG(INFO) << "Trace stop requested, but no trace currently running";
214 return;
215 }
216
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700217 Runtime::Current()->GetThreadList()->SuspendAll();
jeffhao2692b572011-12-16 15:42:28 -0800218
jeffhao725a9572012-11-13 18:20:12 -0800219 Runtime::Current()->GetInstrumentation()->GetTrace()->FinishTracing();
jeffhao2692b572011-12-16 15:42:28 -0800220 Runtime::Current()->DisableMethodTracing();
221
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700222 Runtime::Current()->GetThreadList()->ResumeAll();
jeffhao2692b572011-12-16 15:42:28 -0800223}
224
jeffhaob5e81852012-03-12 11:15:45 -0700225void Trace::Shutdown() {
226 if (!Runtime::Current()->IsMethodTracingActive()) {
227 LOG(INFO) << "Trace shutdown requested, but no trace currently running";
228 return;
229 }
jeffhao725a9572012-11-13 18:20:12 -0800230 Runtime::Current()->GetInstrumentation()->GetTrace()->FinishTracing();
jeffhaob5e81852012-03-12 11:15:45 -0700231 Runtime::Current()->DisableMethodTracing();
232}
233
jeffhao2692b572011-12-16 15:42:28 -0800234void Trace::BeginTracing() {
235 // Set the start time of tracing.
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800236 start_time_ = MicroTime();
237
jeffhao2692b572011-12-16 15:42:28 -0800238 // Set trace version and record size.
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800239 if (UseThreadCpuClock() && UseWallClock()) {
240 trace_version_ = kTraceVersionDualClock;
241 record_size_ = kTraceRecordSizeDualClock;
242 } else {
243 trace_version_ = kTraceVersionSingleClock;
244 record_size_ = kTraceRecordSizeSingleClock;
245 }
246
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800247 // Set up the beginning of the trace.
jeffhao2692b572011-12-16 15:42:28 -0800248 memset(buf_.get(), 0, kTraceHeaderLength);
249 Append4LE(buf_.get(), kTraceMagicValue);
250 Append2LE(buf_.get() + 4, trace_version_);
251 Append2LE(buf_.get() + 6, kTraceHeaderLength);
252 Append8LE(buf_.get() + 8, start_time_);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800253 if (trace_version_ >= kTraceVersionDualClock) {
jeffhao2692b572011-12-16 15:42:28 -0800254 Append2LE(buf_.get() + 16, record_size_);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800255 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800256
jeffhao2692b572011-12-16 15:42:28 -0800257 // Update current offset.
258 cur_offset_ = kTraceHeaderLength;
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800259
260 // Install all method tracing stubs.
jeffhao725a9572012-11-13 18:20:12 -0800261 Runtime::Current()->GetInstrumentation()->InstallStubs();
jeffhaoe343b762011-12-05 16:36:44 -0800262}
263
jeffhao2692b572011-12-16 15:42:28 -0800264void Trace::FinishTracing() {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800265 // Uninstall all method tracing stubs.
jeffhao725a9572012-11-13 18:20:12 -0800266 Runtime::Current()->GetInstrumentation()->UninstallStubs();
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800267
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800268 // Compute elapsed time.
269 uint64_t elapsed = MicroTime() - start_time_;
270
271 size_t final_offset = cur_offset_;
Elliott Hughese119a362012-05-22 17:37:06 -0700272 uint32_t clock_overhead = GetClockOverhead(this);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800273
jeffhao0791adc2012-04-04 11:14:32 -0700274 if ((flags_ & kTraceCountAllocs) != 0) {
275 Runtime::Current()->SetStatsEnabled(false);
276 }
277
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800278 GetVisitedMethods(final_offset);
279
280 std::ostringstream os;
281
282 os << StringPrintf("%cversion\n", kTraceTokenChar);
283 os << StringPrintf("%d\n", trace_version_);
284 os << StringPrintf("data-file-overflow=%s\n", overflow_ ? "true" : "false");
285 if (UseThreadCpuClock()) {
286 if (UseWallClock()) {
287 os << StringPrintf("clock=dual\n");
288 } else {
289 os << StringPrintf("clock=thread-cpu\n");
290 }
291 } else {
292 os << StringPrintf("clock=wall\n");
293 }
294 os << StringPrintf("elapsed-time-usec=%llu\n", elapsed);
Elliott Hughesad6c9c32012-01-19 17:39:12 -0800295 os << StringPrintf("num-method-calls=%zd\n", (final_offset - kTraceHeaderLength) / record_size_);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800296 os << StringPrintf("clock-call-overhead-nsec=%d\n", clock_overhead);
297 os << StringPrintf("vm=art\n");
jeffhao0791adc2012-04-04 11:14:32 -0700298 if ((flags_ & kTraceCountAllocs) != 0) {
299 os << StringPrintf("alloc-count=%d\n", Runtime::Current()->GetStat(KIND_ALLOCATED_OBJECTS));
300 os << StringPrintf("alloc-size=%d\n", Runtime::Current()->GetStat(KIND_ALLOCATED_BYTES));
301 os << StringPrintf("gc-count=%d\n", Runtime::Current()->GetStat(KIND_GC_INVOCATIONS));
302 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800303 os << StringPrintf("%cthreads\n", kTraceTokenChar);
304 DumpThreadList(os);
305 os << StringPrintf("%cmethods\n", kTraceTokenChar);
306 DumpMethodList(os);
307 os << StringPrintf("%cend\n", kTraceTokenChar);
308
309 std::string header(os.str());
jeffhao2692b572011-12-16 15:42:28 -0800310 if (trace_file_.get() == NULL) {
Elliott Hughes7b9d9962012-04-20 18:48:18 -0700311 iovec iov[2];
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800312 iov[0].iov_base = reinterpret_cast<void*>(const_cast<char*>(header.c_str()));
313 iov[0].iov_len = header.length();
jeffhao2692b572011-12-16 15:42:28 -0800314 iov[1].iov_base = buf_.get();
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800315 iov[1].iov_len = final_offset;
316 Dbg::DdmSendChunkV(CHUNK_TYPE("MPSE"), iov, 2);
317 } else {
318 if (!trace_file_->WriteFully(header.c_str(), header.length()) ||
jeffhao2692b572011-12-16 15:42:28 -0800319 !trace_file_->WriteFully(buf_.get(), final_offset)) {
Elliott Hughes7b9d9962012-04-20 18:48:18 -0700320 std::string detail(StringPrintf("Trace data write failed: %s", strerror(errno)));
321 PLOG(ERROR) << detail;
322 Thread::Current()->ThrowNewException("Ljava/lang/RuntimeException;", detail.c_str());
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800323 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800324 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800325}
326
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800327void Trace::LogMethodTraceEvent(Thread* self, const mirror::AbstractMethod* method,
328 Trace::TraceEvent event) {
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800329 if (thread_clock_base_map_.find(self) == thread_clock_base_map_.end()) {
330 uint64_t time = ThreadCpuMicroTime();
Elliott Hughesa0e18062012-04-13 15:59:59 -0700331 thread_clock_base_map_.Put(self, time);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800332 }
333
334 // Advance cur_offset_ atomically.
335 int32_t new_offset;
336 int32_t old_offset;
337 do {
338 old_offset = cur_offset_;
339 new_offset = old_offset + record_size_;
340 if (new_offset > buffer_size_) {
341 overflow_ = true;
342 return;
343 }
344 } while (android_atomic_release_cas(old_offset, new_offset, &cur_offset_) != 0);
345
346 uint32_t method_value = TraceMethodCombine(reinterpret_cast<uint32_t>(method), event);
347
348 // Write data
jeffhao2692b572011-12-16 15:42:28 -0800349 uint8_t* ptr = buf_.get() + old_offset;
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800350 Append2LE(ptr, self->GetTid());
351 Append4LE(ptr + 2, method_value);
352 ptr += 6;
353
354 if (UseThreadCpuClock()) {
355 uint64_t thread_clock_base = thread_clock_base_map_.find(self)->second;
356 uint32_t thread_clock_diff = ThreadCpuMicroTime() - thread_clock_base;
357 Append4LE(ptr, thread_clock_diff);
358 ptr += 4;
359 }
360
361 if (UseWallClock()) {
362 uint32_t wall_clock_diff = MicroTime() - start_time_;
363 Append4LE(ptr, wall_clock_diff);
364 }
365}
366
367void Trace::GetVisitedMethods(size_t end_offset) {
jeffhao2692b572011-12-16 15:42:28 -0800368 uint8_t* ptr = buf_.get() + kTraceHeaderLength;
369 uint8_t* end = buf_.get() + end_offset;
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800370
371 while (ptr < end) {
372 uint32_t method_value = ptr[2] | (ptr[3] << 8) | (ptr[4] << 16) | (ptr[5] << 24);
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800373 mirror::AbstractMethod* method =
374 reinterpret_cast<mirror::AbstractMethod*>(TraceMethodId(method_value));
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800375 visited_methods_.insert(method);
376 ptr += record_size_;
377 }
378}
379
380void Trace::DumpMethodList(std::ostream& os) {
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800381 typedef std::set<const mirror::AbstractMethod*>::const_iterator It; // TODO: C++0x auto
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800382 for (It it = visited_methods_.begin(); it != visited_methods_.end(); ++it) {
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800383 const mirror::AbstractMethod* method = *it;
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800384 MethodHelper mh(method);
Ian Rogers0399dde2012-06-06 17:09:28 -0700385 os << StringPrintf("%p\t%s\t%s\t%s\t%s\n", method,
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800386 PrettyDescriptor(mh.GetDeclaringClassDescriptor()).c_str(), mh.GetName(),
Ian Rogers0399dde2012-06-06 17:09:28 -0700387 mh.GetSignature().c_str(), mh.GetDeclaringClassSourceFile());
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800388 }
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800389}
390
391static void DumpThread(Thread* t, void* arg) {
Elliott Hughesffb465f2012-03-01 18:46:05 -0800392 std::ostream& os = *reinterpret_cast<std::ostream*>(arg);
393 std::string name;
394 t->GetThreadName(name);
395 os << t->GetTid() << "\t" << name << "\n";
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800396}
397
398void Trace::DumpThreadList(std::ostream& os) {
Ian Rogers81d425b2012-09-27 16:03:43 -0700399 Thread* self = Thread::Current();
400 Locks::thread_list_lock_->AssertNotHeld(self);
401 MutexLock mu(self, *Locks::thread_list_lock_);
jeffhaoa9ef3fd2011-12-13 18:33:43 -0800402 Runtime::Current()->GetThreadList()->ForEach(DumpThread, &os);
jeffhaoe343b762011-12-05 16:36:44 -0800403}
404
jeffhaoe343b762011-12-05 16:36:44 -0800405} // namespace art