summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/common/library/c_stats.c
blob: 932c91cfbd5f3e12572b77b19f3530f410cfa801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*******************************************************************************
 * Copyright (c) 2000, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/

#include "swt.h"
#include "c_stats.h"

#ifdef NATIVE_STATS

char * C_nativeFunctionNames[] = {
	"PTR_1sizeof",
	"free",
	"getenv",
	"malloc",
#ifndef JNI64
	"memmove__III",
#else
	"memmove__JJJ",
#endif
#ifndef JNI64
	"memmove__I_3BI",
#else
	"memmove__J_3BJ",
#endif
#ifndef JNI64
	"memmove__I_3CI",
#else
	"memmove__J_3CJ",
#endif
#ifndef JNI64
	"memmove__I_3DI",
#else
	"memmove__J_3DJ",
#endif
#ifndef JNI64
	"memmove__I_3FI",
#else
	"memmove__J_3FJ",
#endif
#ifndef JNI64
	"memmove__I_3II",
#else
	"memmove__J_3IJ",
#endif
#ifndef JNI64
	"memmove__I_3JI",
#else
	"memmove__J_3JJ",
#endif
#ifndef JNI64
	"memmove__I_3SI",
#else
	"memmove__J_3SJ",
#endif
#ifndef JNI64
	"memmove___3BII",
#else
	"memmove___3BJJ",
#endif
#ifndef JNI64
	"memmove___3B_3CI",
#else
	"memmove___3B_3CJ",
#endif
#ifndef JNI64
	"memmove___3CII",
#else
	"memmove___3CJJ",
#endif
#ifndef JNI64
	"memmove___3DII",
#else
	"memmove___3DJJ",
#endif
#ifndef JNI64
	"memmove___3FII",
#else
	"memmove___3FJJ",
#endif
#ifndef JNI64
	"memmove___3III",
#else
	"memmove___3IJJ",
#endif
#ifndef JNI64
	"memmove___3I_3BI",
#else
	"memmove___3I_3BJ",
#endif
#ifndef JNI64
	"memmove___3JII",
#else
	"memmove___3JJJ",
#endif
#ifndef JNI64
	"memmove___3SII",
#else
	"memmove___3SJJ",
#endif
	"memset",
	"strlen",
};
#define NATIVE_FUNCTION_COUNT sizeof(C_nativeFunctionNames) / sizeof(char*)
int C_nativeFunctionCount = NATIVE_FUNCTION_COUNT;
int C_nativeFunctionCallCount[NATIVE_FUNCTION_COUNT];

#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func

JNIEXPORT jint JNICALL STATS_NATIVE(C_1GetFunctionCount)
	(JNIEnv *env, jclass that)
{
	return C_nativeFunctionCount;
}

JNIEXPORT jstring JNICALL STATS_NATIVE(C_1GetFunctionName)
	(JNIEnv *env, jclass that, jint index)
{
	return (*env)->NewStringUTF(env, C_nativeFunctionNames[index]);
}

JNIEXPORT jint JNICALL STATS_NATIVE(C_1GetFunctionCallCount)
	(JNIEnv *env, jclass that, jint index)
{
	return C_nativeFunctionCallCount[index];
}

#endif