[Internal: API change] When profile gets, input param changed.
authorsanghyuk Ko <sanghyuk.ko@samsung.com>
Wed, 20 Mar 2013 08:26:48 +0000 (17:26 +0900)
committersanghyuk Ko <sanghyuk.ko@samsung.com>
Wed, 20 Mar 2013 08:26:48 +0000 (17:26 +0900)
[Problem]
-
[Cause]
-
[Solution]
- When profile gets, input param changed.

Change-Id: I14bd146a3963947787fd0492e89ed3620c6d5cc5

include/event/oma_ds_api.h
src/framework/event/oma_ds_api.c
test/client/oma-ds/oma_ds_client.c

index 7fd52b1..979fff0 100755 (executable)
@@ -69,14 +69,15 @@ extern "C" {
  * Enumerations of sync interval
  */
        typedef enum {
-               SYNC_AGENT_SYNC_INTERVAL_5_MINUTES = 0,                                 /**< 5 minutes */
-               SYNC_AGENT_SYNC_INTERVAL_15_MINUTES = 1,                                /**< 15 minutes */
-               SYNC_AGENT_SYNC_INTERVAL_1_HOUR = 2,                                            /**< 1 hour */
-               SYNC_AGENT_SYNC_INTERVAL_4_HOURS = 3,                                   /**< 4 hours */
-               SYNC_AGENT_SYNC_INTERVAL_12_HOURS = 4,                                  /**< 12 hours */
-               SYNC_AGENT_SYNC_INTERVAL_1_DAY = 5,                                             /**< 1 day */
-               SYNC_AGENT_SYNC_INTERVAL_1_WEEK = 6,                                            /**< 1 week */
-               SYNC_AGENT_SYNC_INTERVAL_1_MONTH = 7                                    /**< 1 month */
+               SYNC_AGENT_SYNC_INTERVAL_NONE = 0,                                      /**< None */
+               SYNC_AGENT_SYNC_INTERVAL_5_MINUTES = 1,                                 /**< 5 minutes */
+               SYNC_AGENT_SYNC_INTERVAL_15_MINUTES = 2,                                /**< 15 minutes */
+               SYNC_AGENT_SYNC_INTERVAL_1_HOUR = 3,                                            /**< 1 hour */
+               SYNC_AGENT_SYNC_INTERVAL_4_HOURS = 4,                                   /**< 4 hours */
+               SYNC_AGENT_SYNC_INTERVAL_12_HOURS = 5,                                  /**< 12 hours */
+               SYNC_AGENT_SYNC_INTERVAL_1_DAY = 6,                                             /**< 1 day */
+               SYNC_AGENT_SYNC_INTERVAL_1_WEEK = 7,                                            /**< 1 week */
+               SYNC_AGENT_SYNC_INTERVAL_1_MONTH = 8                                    /**< 1 month */
        } sync_agent_ds_sync_interval_e;
 
 /**
@@ -129,6 +130,7 @@ extern "C" {
  * @brief      Structure of OMA DS Profile information instance
  */
        typedef struct {
+               int profile_id;                                                                 /**< Profile id */
                char *profile_dir_name;                                         /**< Profile dir name */
                char *profile_name;                                                     /**< Profile name */
                sync_agent_ds_server_info server_info;          /**< Server information */
@@ -362,15 +364,48 @@ extern "C" {
        sync_agent_ds_error_e sync_agent_ds_set_sync_service_info(ds_profile_h profile_h, sync_agent_ds_service_type_e service_type, int enabled, sync_agent_ds_src_uri_e src_uri, char *tgt_uri, char *id, char *password);
 
 /**
- * @brief get profile dir name, profile name from profile info
+ * @brief get profile id, profile id from profile info
  * @par Usage:
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 0;
+ * GList **profile_list = NULL;
+ *
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_all_profile(&profile_list);
+ * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
+ *     ...
+ * }
+ *
+ * for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
+ *             profile_h = (ds_profile_h)iter->data;
+ *     ...
+ *
+ * ds_err = sync_agent_ds_get_profile_id(profile_h, &profile_id);
+ * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
+ *     ...
+ * }
+ *
+ *     ...
+ *
+ * @endcode
+ * @param[in]  profile_h                       profile info
+ * @param[out] profile_id      profile_id
+ * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
+ * @see sync_agent_ds_get_profile
+ */
+       sync_agent_ds_error_e sync_agent_ds_get_profile_id(ds_profile_h profile_h, int *profile_id);
+
+/**
+ * @brief get profile dir name, profile dir name from profile info
+ * @par Usage:
+ * @code
+ *
+ * ds_profile_h profile_h = NULL;
+ * int profile_id = 1;
  * char *get_profile_dir_name = NULL;
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -398,10 +433,10 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * char *profile_name = NULL;
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -429,10 +464,10 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * sync_agent_ds_server_info server_info = {NULL};
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -460,10 +495,10 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * sync_agent_ds_sync_info sync_info = {NULL};
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -491,10 +526,10 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * GList service_list = NULL;
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -522,11 +557,11 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * int last_sync_status = 0;
  * int last_sync_time = 0;
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -555,10 +590,10 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
+ * int profile_id = 1;
  * GList *statistics_list = NULL;
  *
- * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
+ * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -586,7 +621,6 @@ extern "C" {
  * @code
  *
  * ds_profile_h profile_h = NULL;
- * char *profile_dir_name = "Sync1";
  * char *profile_name = "profile name";
  *
  * char *addr = "http://xxx.xxx.xxx";
@@ -612,7 +646,7 @@ extern "C" {
  * }
  *
  *
- * ds_err = sync_agent_ds_set_profile_name(profile_h, profile_dir_name, profile_name);
+ * ds_err = sync_agent_ds_set_profile_name(profile_h, profile_name);
  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
  *     ...
  * }
@@ -664,12 +698,12 @@ extern "C" {
  * }
  *
  * @endcode
- * @param[in]  profile_dir_name                profile dir name
+ * @param[in]  profile_id              profile id
  * @param[out] profile_h               profile info
  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
  * @see sync_agent_ds_free_profile_info
  */
-       sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_name, ds_profile_h * profile_h);
+       sync_agent_ds_error_e sync_agent_ds_get_profile(int profile_id, ds_profile_h * profile_h);
 
 /**
  * @brief get all profiles info
index b0f0f88..af5e068 100755 (executable)
@@ -52,6 +52,7 @@
 #define SYNC_MODE_PUSH_STR "Push"
 #define SYNC_MODE_PERIODIC_STR "Periodic"
 
+#define SYNC_INTERVAL_NONE "None"
 #define SYNC_INTERVAL_5_MINUTES "5 minutes"
 #define SYNC_INTERVAL_15_MINUTES "15 minutes"
 #define SYNC_INTERVAL_1_HOUR "1 hour"
@@ -357,6 +358,7 @@ static char * _convert_sync_interval_str(sync_agent_ds_sync_interval_e interval)
                        interval_str = SYNC_INTERVAL_1_MONTH;
                        break;
                default:
+                       interval_str = SYNC_INTERVAL_NONE;
                        break;
        }
 
@@ -751,6 +753,31 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_set_sync_service_info(ds_profile_
        return result;
 }
 
+EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile_id(ds_profile_h profile_h, int *profile_id)
+{
+       _EXTERN_FUNC_ENTER;
+
+       // check mandatory parameter
+       retvm_if(profile_h == NULL, SYNC_AGENT_DS_FAIL, "profile handle is null!!");
+
+       sync_agent_ds_profile_info *profile_info = (sync_agent_ds_profile_info *) profile_h;
+
+       sync_agent_ds_error_e result = SYNC_AGENT_DS_SUCCESS;
+
+       *profile_id = profile_info->profile_id;
+
+       if (*profile_id < 1) {
+               _DEBUG_ERROR("profile_id is invalid!!");
+               return SYNC_AGENT_DS_FAIL;
+       }
+
+       _DEBUG_INFO("profile_id = %d", *profile_id);
+
+       _EXTERN_FUNC_EXIT;
+
+       return result;
+}
+
 EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile_dir_name(ds_profile_h profile_h, char **profile_dir_name)
 {
        _EXTERN_FUNC_ENTER;
@@ -1052,12 +1079,12 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_add_profile(ds_profile_h profile_
        return SYNC_AGENT_DS_SUCCESS;
 }
 
-EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_name, ds_profile_h * profile_h)
+EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(int profile_id, ds_profile_h * profile_h)
 {
        _EXTERN_FUNC_ENTER;
 
        // check mandatory parameter
-       retvm_if(profile_dir_name == NULL, SYNC_AGENT_DS_FAIL, "profile_dir_name is null!!");
+       retvm_if(profile_id < 1, SYNC_AGENT_DS_FAIL, "profile_id is invalid!!");
 
        int event_type = SYNC_AGENT_DS_GET_PROFILE;
        sync_agent_event_error_e error = SYNC_AGENT_EVENT_SUCCESS;
@@ -1082,7 +1109,8 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_nam
        }
 
        /* add request parameter to event packet */
-       sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_STRING, (void *)profile_dir_name);
+       sync_agent_append_event_data_param(request_event, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &profile_id);
+       _DEBUG_INFO("profile_id = %d", profile_id);
 
        /* send event request to ds agent daemon, waiting for response */
        response_event = sync_agent_send_event(request_event, &error);
@@ -1123,8 +1151,9 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_nam
                return SYNC_AGENT_DS_FAIL;
        }
 
-       profile_info->profile_dir_name = g_strdup(profile_dir_name);
+       //profile_info->profile_dir_name = g_strdup(profile_dir_name);
 
+       sync_agent_get_event_data_param_str(response_event, &profile_info->profile_dir_name);
        sync_agent_get_event_data_param_str(response_event, &profile_info->profile_name);
        sync_agent_get_event_data_param_str(response_event, &server_info->addr);
        sync_agent_get_event_data_param_str(response_event, &server_info->id);
@@ -1135,7 +1164,8 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_nam
        sync_agent_get_event_data_param_int(response_event, &profile_info->last_sync_status);
        sync_agent_get_event_data_param_int(response_event, &profile_info->last_sync_time);
 
-       _DEBUG_INFO("profileDirame = %s", profile_info->profile_name);
+       _DEBUG_INFO("profile_dir_name = %s", profile_info->profile_dir_name);
+       _DEBUG_INFO("profile_name = %s", profile_info->profile_name);
        _DEBUG_INFO("addr = %s", server_info->addr);
        _DEBUG_INFO("id = %s", server_info->id);
        _DEBUG_INFO("password = %s", server_info->password);
@@ -1149,24 +1179,16 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_profile(char *profile_dir_nam
        sync_agent_free_event(request_event);
        sync_agent_free_event_data(response_event);
 
-       //////////////////////////////////
-       //
        // Phase 2. get sync category info
 
        /* get contacts sync_category */
-       result_sync_category = _get_sync_category(profile_dir_name, SYNC_AGENT_DS_SYNC_CONTACTS, &category);
+       result_sync_category = _get_sync_category(profile_info->profile_dir_name, SYNC_AGENT_DS_SYNC_CONTACTS, &category);
        if (result_sync_category)
                profile_info->service_list = g_list_append(profile_info->service_list, category);
 
        /* get schedule sync_category */
        category = NULL;
-       result_sync_category = _get_sync_category(profile_dir_name, SYNC_AGENT_DS_SYNC_SCHEDULE, &category);
-       if (result_sync_category)
-               profile_info->service_list = g_list_append(profile_info->service_list, category);
-
-       /* get memo sync_category */
-       category = NULL;
-       result_sync_category = _get_sync_category(profile_dir_name, SYNC_AGENT_DS_SYNC_MEMO, &category);
+       result_sync_category = _get_sync_category(profile_info->profile_dir_name, SYNC_AGENT_DS_SYNC_SCHEDULE, &category);
        if (result_sync_category)
                profile_info->service_list = g_list_append(profile_info->service_list, category);
 
@@ -1243,6 +1265,7 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_all_profile(GList ** profile_
                sync_agent_ds_server_info *server_info = &profile_info->server_info;
                sync_agent_ds_sync_info *sync_info = &profile_info->sync_info;
 
+               sync_agent_get_event_data_param_int(response_event, &profile_info->profile_id);
                sync_agent_get_event_data_param_str(response_event, &profile_info->profile_dir_name);
                sync_agent_get_event_data_param_str(response_event, &profile_info->profile_name);
                sync_agent_get_event_data_param_str(response_event, &server_info->addr);
@@ -1254,6 +1277,7 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_get_all_profile(GList ** profile_
                sync_agent_get_event_data_param_int(response_event, &profile_info->last_sync_status);
                sync_agent_get_event_data_param_int(response_event, &profile_info->last_sync_time);
 
+               _DEBUG_INFO("profile_info->profile_id = %d", profile_info->profile_id);
                _DEBUG_INFO("profile_info->profile_dir_name = %s", profile_info->profile_dir_name);
                _DEBUG_INFO("profile_info->profile_name = %s", profile_info->profile_name);
                _DEBUG_INFO("profile_info->addr = %s", server_info->addr);
index 77a2151..0022ceb 100755 (executable)
@@ -395,8 +395,10 @@ static gboolean __test_get_profile()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
-       char *profileName = NULL;
+       //char *profileDirName = "Sync1";
+       int profile_id = 1;
+       char *profile_dir_name = NULL;
+       char *profile_name = NULL;
        sync_agent_ds_server_info server_info = { NULL };
        sync_agent_ds_sync_info sync_info = { 0, };
        GList *category_list = NULL;
@@ -407,7 +409,7 @@ static gboolean __test_get_profile()
        int lastSessionStatus = 0, lastSessionTime = 0;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -421,13 +423,23 @@ static gboolean __test_get_profile()
        }
 
        // 1. get profile dir/name
-       result = sync_agent_ds_get_profile_name(profile_h, &profileName);
+       result = sync_agent_ds_get_profile_dir_name(profile_h, &profile_dir_name);
+       if (result == SYNC_AGENT_DS_SUCCESS) {
+               _DEBUG_VERBOSE("Success to get profile_dir_name!");
+               _DEBUG_VERBOSE("profile_dir_name = %s", profile_dir_name);
+               is_test_successful = TRUE;
+       } else {
+               _DEBUG_VERBOSE("Failed to get profile_dir_name!!");
+               is_test_successful = FALSE;
+       }
+
+       result = sync_agent_ds_get_profile_name(profile_h, &profile_name);
        if (result == SYNC_AGENT_DS_SUCCESS) {
-               _DEBUG_VERBOSE("Success to get profile name!");
-               _DEBUG_VERBOSE("get_profileName = %s", profileName);
+               _DEBUG_VERBOSE("Success to get profile_name!");
+               _DEBUG_VERBOSE("profile_name = %s", profile_name);
                is_test_successful = TRUE;
        } else {
-               _DEBUG_VERBOSE("Failed to get profile name!");
+               _DEBUG_VERBOSE("Failed to get profile_name!");
                is_test_successful = FALSE;
        }
 
@@ -491,7 +503,8 @@ static gboolean __test_get_profile()
        }
 
        // free profile information
-       g_free(profileName);
+       g_free(profile_dir_name);
+       g_free(profile_name);
 
        g_free(server_info.addr);
        g_free(server_info.id);
@@ -516,7 +529,9 @@ static gboolean __test_get_all_profiles()
        GList *iter = NULL;
        ds_profile_h profile_h = NULL;
 
-       char *profileName = NULL;
+       int profile_id = -1;
+       char *profile_dir_name = NULL;
+       char *profile_name = NULL;
        sync_agent_ds_server_info server_info = { NULL };
        sync_agent_ds_sync_info sync_info = { 0, };
        GList *category_list = NULL;
@@ -543,14 +558,34 @@ static gboolean __test_get_all_profiles()
        for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
                profile_h = (ds_profile_h) iter->data;
 
-               // 1. get profile dir/name
-               result = sync_agent_ds_get_profile_name(profile_h, &profileName);
+               // 1. get profile id / dir_name /name
+               result = sync_agent_ds_get_profile_id(profile_h, &profile_id);
                if (result == SYNC_AGENT_DS_SUCCESS) {
-                       _DEBUG_VERBOSE("Success to get profile name!");
-                       _DEBUG_VERBOSE("get_profileName = %s", profileName);
+                       _DEBUG_VERBOSE("Success to get profile_id!");
+                       _DEBUG_VERBOSE("profile_id = %d", profile_id);
                        is_test_successful = TRUE;
                } else {
-                       _DEBUG_VERBOSE("Failed to get profile name!");
+                       _DEBUG_VERBOSE("Failed to get profile_id!");
+                       is_test_successful = FALSE;
+               }
+
+               result = sync_agent_ds_get_profile_dir_name(profile_h, &profile_dir_name);
+               if (result == SYNC_AGENT_DS_SUCCESS) {
+                       _DEBUG_VERBOSE("Success to get profile_dir_name!");
+                       _DEBUG_VERBOSE("profile_dir_name = %s", profile_dir_name);
+                       is_test_successful = TRUE;
+               } else {
+                       _DEBUG_VERBOSE("Failed to get profile_dir_name!");
+                       is_test_successful = FALSE;
+               }
+
+               result = sync_agent_ds_get_profile_name(profile_h, &profile_name);
+               if (result == SYNC_AGENT_DS_SUCCESS) {
+                       _DEBUG_VERBOSE("Success to get profile_name!");
+                       _DEBUG_VERBOSE("profile_name = %s", profile_name);
+                       is_test_successful = TRUE;
+               } else {
+                       _DEBUG_VERBOSE("Failed to get profile_name!");
                        is_test_successful = FALSE;
                }
 
@@ -615,8 +650,8 @@ static gboolean __test_get_all_profiles()
                }
 
                // free profile information
-               g_free(profileName);
-
+               g_free(profile_dir_name);
+               g_free(profile_name);
                g_free(server_info.addr);
                g_free(server_info.id);
                g_free(server_info.password);
@@ -646,13 +681,13 @@ static gboolean __test_get_sync_statistics()
 
        GList *statistics_list = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        int category_count = 0;
        int i = 0;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -709,10 +744,10 @@ static gboolean __test_start_sync()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -750,10 +785,10 @@ static gboolean __test_stop_sync()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");