4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 * @desc Implement Performance API. Joining performance control.
23 * Entity for creation cgroup
26 #include <resourced.h>
29 #include "edbus-handler.h"
33 #ifdef NETWORK_SERVICE_OFF
34 API resourced_ret_c join_app_performance(const char *app_id, const pid_t pid)
36 return RESOURCED_ERROR_NONE;
41 static resourced_ret_c send_join_message(const char *interface,
42 const char *format_str, char *params[])
46 resourced_ret_c ret_val;
50 msg = dbus_method_sync(BUS_NAME, RESOURCED_PATH_NETWORK,
51 RESOURCED_INTERFACE_NETWORK,
56 _E("Re-try to sync DBUS message, err_count : %d", i);
57 } while (i++ < RETRY_MAX);
60 _E("Failed to sync DBUS message.");
61 return RESOURCED_ERROR_FAIL;
64 dbus_error_init(&err);
66 ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val,
70 _E("no message : [%s:%s]\n", err.name, err.message);
71 ret_val = RESOURCED_ERROR_FAIL;
74 dbus_message_unref(msg);
75 dbus_error_free(&err);
80 API resourced_ret_c join_app_performance(const char *app_id, const pid_t pid)
85 return RESOURCED_ERROR_INVALID_PARAMETER;
87 serialize_params(params, ARRAY_SIZE(params), app_id, pid);
89 return send_join_message(RESOURCED_NETWORK_JOIN_NET_STAT, "sd", params);