<commit_before>/***************************************************************
 *
 * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
 * University of Wisconsin-Madison, WI.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ***************************************************************/


#include "condor_common.h"
#include "proc_family.h"
#include "proc_family_monitor.h"
#include "procd_common.h"

#if !defined(WIN32)
#include "glexec_kill.unix.h"
#endif

#if defined(HAVE_EXT_LIBCGROUP)
#include "libcgroup.h"

#define FROZEN "FROZEN"
#define THAWED "THAWED"
#define BLOCK_STATS_LINE_MAX 64

#include <unistd.h>
long ProcFamily::clock_tick = sysconf( _SC_CLK_TCK );

// Swap accounting is sometimes turned off.  We use this variable so we
// warn about that situation only once.
bool ProcFamily::have_warned_about_memsw = false;
#endif

ProcFamily::ProcFamily(ProcFamilyMonitor* monitor,
                       pid_t              root_pid,
                       birthday_t         root_birthday,
                       pid_t              watcher_pid,
                       int                max_snapshot_interval) :
	m_monitor(monitor),
	m_root_pid(root_pid),
	m_root_birthday(root_birthday),
	m_watcher_pid(watcher_pid),
	m_max_snapshot_interval(max_snapshot_interval),
	m_exited_user_cpu_time(0),
	m_exited_sys_cpu_time(0),
	m_max_image_size(0),
	m_member_list(NULL)
#if defined(HAVE_EXT_LIBCGROUP)
	, m_cgroup_string(""),
	m_cm(CgroupManager::getInstance()),
	m_initial_user_cpu(0),
	m_initial_sys_cpu(0),
	m_last_signal_was_sigstop(false)
#endif
#ifdef LINUX
	, m_perf_counter(root_pid)
#endif
{
#if !defined(WIN32)
	m_proxy = NULL;
#endif
#ifdef LINUX
	m_perf_counter.start();
#endif
}

ProcFamily::~ProcFamily()
{
	// delete our member list
	//
	ProcFamilyMember* member = m_member_list;
	while (member != NULL) {
		ProcFamilyMember* next_member = member->m_next;
		//dprintf(D_ALWAYS,
		//        "PROCINFO DEALLOCATION: %p for pid %u\n",
		//        member->m_proc_info,
		//        member->m_proc_info->pid);
		delete member->m_proc_info;
		delete member;
		member = next_member;<commit_msg>Fix out-of-order intialization warning HTCONDOR-742<commit_after>/***************************************************************
 *
 * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
 * University of Wisconsin-Madison, WI.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ***************************************************************/


#include "condor_common.h"
#include "proc_family.h"
#include "proc_family_monitor.h"
#include "procd_common.h"

#if !defined(WIN32)
#include "glexec_kill.unix.h"
#endif

#if defined(HAVE_EXT_LIBCGROUP)
#include "libcgroup.h"

#define FROZEN "FROZEN"
#define THAWED "THAWED"
#define BLOCK_STATS_LINE_MAX 64

#include <unistd.h>
long ProcFamily::clock_tick = sysconf( _SC_CLK_TCK );

// Swap accounting is sometimes turned off.  We use this variable so we
// warn about that situation only once.
bool ProcFamily::have_warned_about_memsw = false;
#endif

ProcFamily::ProcFamily(ProcFamilyMonitor* monitor,
                       pid_t              root_pid,
                       birthday_t         root_birthday,
                       pid_t              watcher_pid,
                       int                max_snapshot_interval) :
	m_monitor(monitor)
	, m_root_pid(root_pid)
	, m_root_birthday(root_birthday)
	, m_watcher_pid(watcher_pid)
	, m_max_snapshot_interval(max_snapshot_interval)
	, m_exited_user_cpu_time(0)
	, m_exited_sys_cpu_time(0)
	, m_max_image_size(0)
	, m_member_list(NULL)
#ifdef LINUX
	, m_perf_counter(root_pid)
#endif
#if defined(HAVE_EXT_LIBCGROUP)
	, m_cgroup_string("")
	, m_cm(CgroupManager::getInstance())
	, m_initial_user_cpu(0)
	, m_initial_sys_cpu(0)
#endif
#if defined(HAVE_EXT_LIBCGROUP)
	, m_last_signal_was_sigstop(false)
#endif
{
#if !defined(WIN32)
	m_proxy = NULL;
#endif
#ifdef LINUX
	m_perf_counter.start();
#endif
}

ProcFamily::~ProcFamily()
{
	// delete our member list
	//
	ProcFamilyMember* member = m_member_list;
	while (member != NULL) {
		ProcFamilyMember* next_member = member->m_next;
		//dprintf(D_ALWAYS,
		//        "PROCINFO DEALLOCATION: %p for pid %u\n",
		//        member->m_proc_info,
		//        member->m_proc_info->pid);
		delete member->m_proc_info;
		delete member;
		member = next_member;
{'fraction_non_alphanumeric': 0.14152873349451367, 'fraction_numerical': 0.009112888227636229, 'mean_word_length': 3.920402561756633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3724249', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1749, 'n_words': 434}